mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2026-02-12 23:07:15 -06:00
ScrollBar: fixed left/top arrow icon location (if visible) (issue #329)
(tested using FlatPaintingTest)
This commit is contained in:
@@ -17,6 +17,7 @@ FlatLaf Change Log
|
|||||||
|
|
||||||
- Fixed white lines at bottom and right side of window (in dark themes on HiDPI
|
- Fixed white lines at bottom and right side of window (in dark themes on HiDPI
|
||||||
screens with scaling enabled).
|
screens with scaling enabled).
|
||||||
|
- ScrollBar: Fixed left/top arrow icon location (if visible). (issue #329)
|
||||||
- ToolTip: Fixed positioning of huge tooltips. (issue #333)
|
- ToolTip: Fixed positioning of huge tooltips. (issue #333)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -679,8 +679,10 @@ public class FlatUIUtils
|
|||||||
int extra = chevron ? 1 : 0;
|
int extra = chevron ? 1 : 0;
|
||||||
|
|
||||||
// compute arrow location
|
// compute arrow location
|
||||||
int ax = x + Math.round( ((width - (aw + extra)) / 2f) + UIScale.scale( (float) xOffset ) );
|
float ox = ((width - (aw + extra)) / 2f) + UIScale.scale( (float) xOffset );
|
||||||
int ay = y + Math.round( ((height - (ah + extra)) / 2f) + UIScale.scale( (float) yOffset ) );
|
float oy = ((height - (ah + extra)) / 2f) + UIScale.scale( (float) yOffset );
|
||||||
|
int ax = x + ((direction == SwingConstants.WEST) ? -Math.round( -ox ) : Math.round( ox ));
|
||||||
|
int ay = y + ((direction == SwingConstants.NORTH) ? -Math.round( -oy ) : Math.round( oy ));
|
||||||
|
|
||||||
// paint arrow
|
// paint arrow
|
||||||
g.translate( ax, ay );
|
g.translate( ax, ay );
|
||||||
|
|||||||
Reference in New Issue
Block a user