diff options
Diffstat (limited to 'examples/custom_widget.rs')
-rw-r--r-- | examples/custom_widget.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/examples/custom_widget.rs b/examples/custom_widget.rs index cf2f7792..0a570745 100644 --- a/examples/custom_widget.rs +++ b/examples/custom_widget.rs @@ -13,7 +13,7 @@ mod circle { layout, Background, Color, Element, Hasher, Layout, Length, MouseCursor, Point, Size, Widget, }; - use iced_wgpu::{Primitive, Renderer}; + use iced_wgpu::{Defaults, Primitive, Renderer}; pub struct Circle { radius: u16, @@ -54,6 +54,7 @@ mod circle { fn draw( &self, _renderer: &mut Renderer, + _defaults: &Defaults, layout: Layout<'_>, _cursor_position: Point, ) -> (Primitive, MouseCursor) { @@ -62,6 +63,8 @@ mod circle { bounds: layout.bounds(), background: Background::Color(Color::BLACK), border_radius: self.radius, + border_width: 0, + border_color: Color::TRANSPARENT, }, MouseCursor::OutOfBounds, ) @@ -124,10 +127,7 @@ impl Sandbox for Example { .max_width(500) .align_items(Align::Center) .push(Circle::new(self.radius)) - .push( - Text::new(format!("Radius: {}", self.radius.to_string())) - .width(Length::Shrink), - ) + .push(Text::new(format!("Radius: {}", self.radius.to_string()))) .push(Slider::new( &mut self.slider, 1.0..=100.0, |