Fix Label text_align.

This commit is contained in:
Jason Lee 2024-07-24 18:39:13 +08:00
parent 6b019e3954
commit c538a231c1

View file

@ -71,13 +71,14 @@ impl RenderOnce for Label {
text.to_string() text.to_string()
}; };
div() div().text_color(cx.theme().foreground).child(
.map(|this| match self.align { self.base
TextAlign::Left => this.justify_start(), .map(|this| match self.align {
TextAlign::Center => this.justify_center(), TextAlign::Left => this.justify_start(),
TextAlign::Right => this.justify_end(), TextAlign::Center => this.justify_center(),
}) TextAlign::Right => this.justify_end(),
.text_color(cx.theme().foreground) })
.child(self.base.child(text_display)) .child(text_display),
)
} }
} }