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
|
|
@ -485,15 +485,20 @@ where
|
|||
};
|
||||
|
||||
if let Some(scrollbar) = scrollbar {
|
||||
renderer.with_layer(bounds, Vector::new(0, offset), |renderer| {
|
||||
self.content.draw(
|
||||
renderer,
|
||||
style,
|
||||
content_layout,
|
||||
cursor_position,
|
||||
&Rectangle {
|
||||
y: bounds.y + offset as f32,
|
||||
..bounds
|
||||
renderer.with_layer(bounds, |renderer| {
|
||||
renderer.with_translation(
|
||||
Vector::new(0.0, -(offset as f32)),
|
||||
|renderer| {
|
||||
self.content.draw(
|
||||
renderer,
|
||||
style,
|
||||
content_layout,
|
||||
cursor_position,
|
||||
&Rectangle {
|
||||
y: bounds.y + offset as f32,
|
||||
..bounds
|
||||
},
|
||||
);
|
||||
},
|
||||
);
|
||||
});
|
||||
|
|
@ -509,7 +514,7 @@ where
|
|||
let is_scrollbar_visible =
|
||||
style.background.is_some() || style.border_width > 0.0;
|
||||
|
||||
renderer.with_layer(bounds, Vector::new(0, 0), |renderer| {
|
||||
renderer.with_layer(bounds, |renderer| {
|
||||
if is_scrollbar_visible {
|
||||
renderer.fill_rectangle(renderer::Quad {
|
||||
bounds: scrollbar.bounds,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue