Skip to content

Commit

Permalink
Fix failure to update dynamic label
Browse files Browse the repository at this point in the history
We were failing to set the text in the update case; this
was a consequence of #1252
  • Loading branch information
cmyr committed Sep 27, 2020
1 parent 199be57 commit aeaf7b4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion druid/src/widget/label.rs
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,11 @@ impl Widget<ArcStr> for RawLabel {
}

fn update(&mut self, ctx: &mut UpdateCtx, old_data: &ArcStr, data: &ArcStr, _env: &Env) {
if !old_data.same(data) | self.layout.needs_rebuild_after_update(ctx) {
if !old_data.same(data) {
self.layout.set_text(data.clone());
ctx.request_layout();
}
if self.layout.needs_rebuild_after_update(ctx) {
ctx.request_layout();
}
}
Expand Down

0 comments on commit aeaf7b4

Please sign in to comment.