Implement Widget::mouse_interaction for PaneGrid

... and fix rendering of drag interaction in `PaneGrid` by
introducing an explicit `with_translation` method to `Renderer`
and simplifying the `with_layer` and `Clip` primitive.
This commit is contained in:
Héctor Ramón Jiménez 2021-10-25 16:16:35 +07:00
parent 41394b4e90
commit 4a11cbd994
No known key found for this signature in database
GPG key ID: 140CC052C94F138E
11 changed files with 167 additions and 66 deletions

View file

@ -175,11 +175,7 @@ impl<'a> Layer<'a> {
});
}
}
Primitive::Clip {
bounds,
offset,
content,
} => {
Primitive::Clip { bounds, content } => {
let layer = &mut layers[current_layer];
let translated_bounds = *bounds + translation;
@ -192,8 +188,7 @@ impl<'a> Layer<'a> {
Self::process_primitive(
layers,
translation
- Vector::new(offset.x as f32, offset.y as f32),
translation,
content,
layers.len() - 1,
);