summaryrefslogtreecommitdiffstats
path: root/native/src/widget/row.rs
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón <hector0193@gmail.com>2020-10-29 02:00:56 +0100
committerLibravatar GitHub <noreply@github.com>2020-10-29 02:00:56 +0100
commitb40775fb7414b44307e343921ef015c65a916dab (patch)
tree06a3fad05b14d3b0f97687bf410fa8bbc04c9526 /native/src/widget/row.rs
parent8a3ce90959e281cd73a7486d800df8d65478a698 (diff)
parent91b1886968b498b913984bdfa4bee840e8821ec6 (diff)
downloadiced-b40775fb7414b44307e343921ef015c65a916dab.tar.gz
iced-b40775fb7414b44307e343921ef015c65a916dab.tar.bz2
iced-b40775fb7414b44307e343921ef015c65a916dab.zip
Merge pull request #584 from hecrj/improvement/viewport-aware-drawing
Viewport aware drawing
Diffstat (limited to '')
-rw-r--r--native/src/widget/row.rs19
1 files changed, 14 insertions, 5 deletions
diff --git a/native/src/widget/row.rs b/native/src/widget/row.rs
index b37a5cfc..bc8a3df1 100644
--- a/native/src/widget/row.rs
+++ b/native/src/widget/row.rs
@@ -1,11 +1,12 @@
//! Distribute content horizontally.
-use std::hash::Hash;
-
+use crate::layout;
+use crate::overlay;
use crate::{
- layout, overlay, Align, Clipboard, Element, Event, Hasher, Layout, Length,
- Point, Widget,
+ Align, Clipboard, Element, Event, Hasher, Layout, Length, Point, Rectangle,
+ Widget,
};
+use std::hash::Hash;
use std::u32;
/// A container that distributes its contents horizontally.
@@ -182,8 +183,15 @@ where
defaults: &Renderer::Defaults,
layout: Layout<'_>,
cursor_position: Point,
+ viewport: &Rectangle,
) -> Renderer::Output {
- renderer.draw(defaults, &self.children, layout, cursor_position)
+ renderer.draw(
+ defaults,
+ &self.children,
+ layout,
+ cursor_position,
+ viewport,
+ )
}
fn hash_layout(&self, state: &mut Hasher) {
@@ -238,6 +246,7 @@ pub trait Renderer: crate::Renderer + Sized {
children: &[Element<'_, Message, Self>],
layout: Layout<'_>,
cursor_position: Point,
+ viewport: &Rectangle,
) -> Self::Output;
}