Skip to content

Commit

Permalink
fix: compilation issues with Alignment due to latest changes
Browse files Browse the repository at this point in the history
  • Loading branch information
zenith391 committed Aug 13, 2024
1 parent 607394b commit 3b33ac5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/components/Alignment.zig
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,17 @@ pub const Alignment = struct {
widget_data: Alignment.WidgetData = .{},

// TODO: when the child property changes, really change it on the Alignment component's peer
child: Atom(*Widget) = Atom(*Widget).of(undefined),
child: Atom(*Widget) = undefined,
relayouting: std.atomic.Value(bool) = std.atomic.Value(bool).init(false),
/// The horizontal alignment of the child component, from 0 (left) to 1 (right).
x: Atom(f32) = Atom(f32).of(0.5),
/// The vertical alignment of the child component, from 0 (top) to 1 (bottom).
y: Atom(f32) = Atom(f32).of(0.5),

pub fn init(config: Alignment.Config) !Alignment {
var component = Alignment.init_events(Alignment{});
var component = Alignment.init_events(Alignment{
.child = Atom(*Widget).of(config.child),
});
internal.applyConfigStruct(&component, config);
try component.addResizeHandler(&onResize);
component.child.get().ref();
Expand Down

0 comments on commit 3b33ac5

Please sign in to comment.