mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2025-12-07 22:40:53 +03:00
MenuItem: fixed horizontal alignment of icons (issue #631)
This commit is contained in:
@@ -26,6 +26,7 @@ FlatLaf Change Log
|
||||
#625)
|
||||
- Updated "Hiberbee Dark" and "Material Theme UI Lite" themes.
|
||||
- Styling: Fixed resolving of UI variables in styles that use other variables.
|
||||
- MenuItem: Fixed horizontal alignment of icons. (issue #631)
|
||||
|
||||
|
||||
## 3.0
|
||||
|
||||
@@ -456,10 +456,11 @@ debug*/
|
||||
return;
|
||||
|
||||
// center because the real icon may be smaller than dimension in iconRect
|
||||
int x = iconRect.x + centerOffset( iconRect.width, icon.getIconWidth() );
|
||||
int y = iconRect.y + centerOffset( iconRect.height, icon.getIconHeight() );
|
||||
|
||||
// paint
|
||||
icon.paintIcon( menuItem, g, iconRect.x, y );
|
||||
icon.paintIcon( menuItem, g, x, y );
|
||||
}
|
||||
|
||||
protected static void paintText( Graphics g, JMenuItem menuItem,
|
||||
|
||||
Reference in New Issue
Block a user