summaryrefslogtreecommitdiffstats
path: root/graphics
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2021-02-27 03:36:46 +0100
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2021-02-27 03:36:46 +0100
commitf52f8c1337f42cf9483abb40784129f4effbe48e (patch)
treeef4e74f0ec0f3d3bb2ad5a9fcaa0ef2d88dba604 /graphics
parenta5fddf9ee648927b294ef34e8819855d5e117b26 (diff)
downloadiced-f52f8c1337f42cf9483abb40784129f4effbe48e.tar.gz
iced-f52f8c1337f42cf9483abb40784129f4effbe48e.tar.bz2
iced-f52f8c1337f42cf9483abb40784129f4effbe48e.zip
Fix `viewport` argument in `PaneGrid` draw calls
Diffstat (limited to 'graphics')
-rw-r--r--graphics/src/widget/pane_grid.rs19
1 files changed, 14 insertions, 5 deletions
diff --git a/graphics/src/widget/pane_grid.rs b/graphics/src/widget/pane_grid.rs
index 3cd4fd34..d06f8c6c 100644
--- a/graphics/src/widget/pane_grid.rs
+++ b/graphics/src/widget/pane_grid.rs
@@ -45,6 +45,7 @@ where
layout: Layout<'_>,
style_sheet: &<Self as pane_grid::Renderer>::Style,
cursor_position: Point,
+ viewport: &Rectangle,
) -> Self::Output {
let pane_cursor_position = if dragging.is_some() {
// TODO: Remove once cursor availability is encoded in the type
@@ -62,8 +63,13 @@ where
.zip(layout.children())
.enumerate()
.map(|(i, ((id, pane), layout))| {
- let (primitive, new_mouse_interaction) =
- pane.draw(self, defaults, layout, pane_cursor_position);
+ let (primitive, new_mouse_interaction) = pane.draw(
+ self,
+ defaults,
+ layout,
+ pane_cursor_position,
+ viewport,
+ );
if new_mouse_interaction > mouse_interaction {
mouse_interaction = new_mouse_interaction;
@@ -180,12 +186,13 @@ where
title_bar: Option<(&TitleBar<'_, Message, Self>, Layout<'_>)>,
body: (&Element<'_, Message, Self>, Layout<'_>),
cursor_position: Point,
+ viewport: &Rectangle,
) -> Self::Output {
let style = style_sheet.style();
let (body, body_layout) = body;
let (body_primitive, body_interaction) =
- body.draw(self, defaults, body_layout, cursor_position, &bounds);
+ body.draw(self, defaults, body_layout, cursor_position, viewport);
let background = crate::widget::container::background(bounds, &style);
@@ -199,6 +206,7 @@ where
defaults,
title_bar_layout,
cursor_position,
+ viewport,
show_controls,
);
@@ -240,6 +248,7 @@ where
content: (&Element<'_, Message, Self>, Layout<'_>),
controls: Option<(&Element<'_, Message, Self>, Layout<'_>)>,
cursor_position: Point,
+ viewport: &Rectangle,
) -> Self::Output {
let style = style_sheet.style();
let (title_content, title_layout) = content;
@@ -257,7 +266,7 @@ where
&defaults,
title_layout,
cursor_position,
- &bounds,
+ viewport,
);
if let Some((controls, controls_layout)) = controls {
@@ -266,7 +275,7 @@ where
&defaults,
controls_layout,
cursor_position,
- &bounds,
+ viewport,
);
(