diff options
| author | 2021-10-14 16:07:22 +0700 | |
|---|---|---|
| committer | 2021-10-14 16:07:22 +0700 | |
| commit | 03b34931383e701c39c653a7662a616fe21a0947 (patch) | |
| tree | 8c0773d50b615dbc62210db8919ecb97ca912bd9 /examples/custom_widget | |
| parent | 3aae45c1913e6a6f60b009f19d00d10add7ad11e (diff) | |
| download | iced-03b34931383e701c39c653a7662a616fe21a0947.tar.gz iced-03b34931383e701c39c653a7662a616fe21a0947.tar.bz2 iced-03b34931383e701c39c653a7662a616fe21a0947.zip  | |
Remove trait-specific draw logic in `iced_native`
Diffstat (limited to 'examples/custom_widget')
| -rw-r--r-- | examples/custom_widget/src/main.rs | 27 | 
1 files changed, 13 insertions, 14 deletions
diff --git a/examples/custom_widget/src/main.rs b/examples/custom_widget/src/main.rs index c9ad1905..648e7295 100644 --- a/examples/custom_widget/src/main.rs +++ b/examples/custom_widget/src/main.rs @@ -11,8 +11,7 @@ mod circle {      // implemented by `iced_wgpu` and other renderers.      use iced_graphics::{Backend, Defaults, Primitive, Renderer};      use iced_native::{ -        layout, mouse, Background, Color, Element, Hasher, Layout, Length, -        Point, Rectangle, Size, Widget, +        layout, Element, Hasher, Layout, Length, Point, Rectangle, Size, Widget,      };      pub struct Circle { @@ -55,20 +54,20 @@ mod circle {              &self,              _renderer: &mut Renderer<B>,              _defaults: &Defaults, -            layout: Layout<'_>, +            _layout: Layout<'_>,              _cursor_position: Point,              _viewport: &Rectangle, -        ) -> (Primitive, mouse::Interaction) { -            ( -                Primitive::Quad { -                    bounds: layout.bounds(), -                    background: Background::Color(Color::BLACK), -                    border_radius: self.radius, -                    border_width: 0.0, -                    border_color: Color::TRANSPARENT, -                }, -                mouse::Interaction::default(), -            ) +        ) { +            // ( +            //     Primitive::Quad { +            //         bounds: layout.bounds(), +            //         background: Background::Color(Color::BLACK), +            //         border_radius: self.radius, +            //         border_width: 0.0, +            //         border_color: Color::TRANSPARENT, +            //     }, +            //     mouse::Interaction::default(), +            // )          }      }  | 
