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:
parent
41394b4e90
commit
4a11cbd994
11 changed files with 167 additions and 66 deletions
|
|
@ -3,7 +3,7 @@ use crate::layout;
|
|||
use crate::mouse;
|
||||
use crate::overlay;
|
||||
use crate::renderer;
|
||||
use crate::{Clipboard, Element, Layout, Point, Rectangle, Size, Vector};
|
||||
use crate::{Clipboard, Element, Layout, Point, Rectangle, Size};
|
||||
|
||||
use std::hash::Hasher;
|
||||
|
||||
|
|
@ -359,18 +359,14 @@ where
|
|||
|
||||
let overlay_bounds = layer.layout.bounds();
|
||||
|
||||
renderer.with_layer(
|
||||
overlay_bounds,
|
||||
Vector::new(0, 0),
|
||||
|renderer| {
|
||||
overlay.draw(
|
||||
renderer,
|
||||
&renderer::Style::default(),
|
||||
Layout::new(&layer.layout),
|
||||
cursor_position,
|
||||
);
|
||||
},
|
||||
);
|
||||
renderer.with_layer(overlay_bounds, |renderer| {
|
||||
overlay.draw(
|
||||
renderer,
|
||||
&renderer::Style::default(),
|
||||
Layout::new(&layer.layout),
|
||||
cursor_position,
|
||||
);
|
||||
});
|
||||
|
||||
self.overlay = Some(layer);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue