mirror of
https://github.com/emilk/egui.git
synced 2026-08-31 05:40:03 -04:00
Fix image button padding on hover (#1595)
This commit is contained in:
@@ -489,18 +489,14 @@ impl Widget for ImageButton {
|
||||
let (expansion, rounding, fill, stroke) = if selected {
|
||||
let selection = ui.visuals().selection;
|
||||
(
|
||||
-padding,
|
||||
Vec2::ZERO,
|
||||
Rounding::none(),
|
||||
selection.bg_fill,
|
||||
selection.stroke,
|
||||
)
|
||||
} else if frame {
|
||||
let visuals = ui.style().interact(&response);
|
||||
let expansion = if response.hovered {
|
||||
Vec2::splat(visuals.expansion) - padding
|
||||
} else {
|
||||
Vec2::splat(visuals.expansion)
|
||||
};
|
||||
let expansion = Vec2::splat(visuals.expansion);
|
||||
(
|
||||
expansion,
|
||||
visuals.rounding,
|
||||
|
||||
Reference in New Issue
Block a user