fix(segmented-button): disappearance of icons from bad layout values

This commit is contained in:
Michael Aaron Murphy 2023-09-13 16:47:42 +02:00 committed by Michael Murphy
parent ef23cb328f
commit 48fd076cc8
2 changed files with 6 additions and 4 deletions

View file

@ -61,5 +61,3 @@ pub mod widget;
pub type Renderer = iced::Renderer<Theme>;
pub type Element<'a, Message> = iced::Element<'a, Message, Renderer>;

View file

@ -508,10 +508,11 @@ where
let mut layout_node = layout::Node::new(Size {
width,
height: width - offset,
height: width,
});
layout_node.move_to(Point {
x: bounds.x + offset,
x: bounds.x,
y: bounds.y,
});
@ -526,6 +527,9 @@ where
viewport,
);
bounds.x += offset;
bounds.width -= offset;
alignment::Horizontal::Left
} else {
bounds.x = bounds.center_x();