mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2026-02-13 07:17:13 -06:00
Menus: use simpler method to compute center offset (same as in SwingUtilities.layoutCompoundLabel()), which gives same results and avoids floats
This commit is contained in:
@@ -184,7 +184,7 @@ public class FlatMenuItemRenderer
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static int centerOffset( int wh1, int wh2 ) {
|
private static int centerOffset( int wh1, int wh2 ) {
|
||||||
return (wh1 != wh2) ? Math.round( (wh1 - wh2) / 2f ) : 0;
|
return (wh1 / 2) - (wh2 / 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void paintMenuItem( Graphics g, Color selectionBackground, Color selectionForeground,
|
protected void paintMenuItem( Graphics g, Color selectionBackground, Color selectionForeground,
|
||||||
|
|||||||
Reference in New Issue
Block a user