Merge pull request #1802 from casperstorm/fix/text_input_icon_misalignment

Center `TextInput::Icon` vertically
This commit is contained in:
Héctor Ramón 2023-04-20 15:30:09 +02:00 committed by GitHub
commit e96f26f357
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -970,9 +970,12 @@ pub fn draw<Renderer>(
size: icon.size.unwrap_or_else(|| renderer.default_size()),
font: icon.font.clone(),
color: appearance.icon_color,
bounds: icon_layout.bounds(),
bounds: Rectangle {
y: text_bounds.center_y(),
..icon_layout.bounds()
},
horizontal_alignment: alignment::Horizontal::Left,
vertical_alignment: alignment::Vertical::Top,
vertical_alignment: alignment::Vertical::Center,
});
}