Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Call update on Painter from Container #991

Merged
merged 1 commit into from
May 26, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ This means that druid no longer requires cairo on macOS and uses Core Graphics i
- Focus request handling is now predictable with the last request overriding earlier ones. ([#948] by [@xStrom])
- Wheel events now properly update hot state. ([#951] by [@xStrom])
- X11: Support mouse scrolling. ([#961] by [@jneem])
- Painter widget not repainting on data change in Container ([#991] by [@cmyr])

### Visual

Expand Down Expand Up @@ -231,6 +232,7 @@ This means that druid no longer requires cairo on macOS and uses Core Graphics i
[#970]: https://github.com/xi-editor/druid/pull/970
[#980]: https://github.com/xi-editor/druid/pull/980
[#982]: https://github.com/xi-editor/druid/pull/982
[#991]: https://github.com/xi-editor/druid/pull/991

## [0.5.0] - 2020-04-01

Expand Down
5 changes: 4 additions & 1 deletion druid/src/widget/container.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,10 @@ impl<T: Data> Widget<T> for Container<T> {
self.inner.lifecycle(ctx, event, data, env)
}

fn update(&mut self, ctx: &mut UpdateCtx, _old_data: &T, data: &T, env: &Env) {
fn update(&mut self, ctx: &mut UpdateCtx, old_data: &T, data: &T, env: &Env) {
if let Some(BackgroundBrush::Painter(p)) = self.background.as_mut() {
p.update(ctx, old_data, data, env);
}
self.inner.update(ctx, data, env);
}

Expand Down