summaryrefslogtreecommitdiffstats
path: root/examples/custom_widget
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2020-08-18 03:37:32 +0200
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2020-10-28 06:21:07 +0100
commitd328b07b3937c968fc8139f0b5c61903ebb893e7 (patch)
tree940ae9e93006ad4fdae2d86a2f70833ee99e0b10 /examples/custom_widget
parent8a3ce90959e281cd73a7486d800df8d65478a698 (diff)
downloadiced-d328b07b3937c968fc8139f0b5c61903ebb893e7.tar.gz
iced-d328b07b3937c968fc8139f0b5c61903ebb893e7.tar.bz2
iced-d328b07b3937c968fc8139f0b5c61903ebb893e7.zip
Introduce `viewport` to `Widget::draw`
This should eventually allow us to only generate primitives that are visible.
Diffstat (limited to 'examples/custom_widget')
-rw-r--r--examples/custom_widget/src/main.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/examples/custom_widget/src/main.rs b/examples/custom_widget/src/main.rs
index 0eba1cd0..a0003d65 100644
--- a/examples/custom_widget/src/main.rs
+++ b/examples/custom_widget/src/main.rs
@@ -12,7 +12,7 @@ mod circle {
use iced_graphics::{Backend, Defaults, Primitive, Renderer};
use iced_native::{
layout, mouse, Background, Color, Element, Hasher, Layout, Length,
- Point, Size, Widget,
+ Point, Rectangle, Size, Widget,
};
pub struct Circle {
@@ -60,6 +60,7 @@ mod circle {
_defaults: &Defaults,
layout: Layout<'_>,
_cursor_position: Point,
+ _viewport: &Rectangle,
) -> (Primitive, mouse::Interaction) {
(
Primitive::Quad {