mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
fixed not symmetric plus signs inside folding anchors - floor to odd
This commit is contained in:
+3
-3
@@ -1139,12 +1139,12 @@ class EditorGutterComponentImpl extends EditorGutterComponentEx implements Mouse
|
||||
|
||||
private int getFoldingAnchorWidth() {
|
||||
// have to be odd number to be perfectly symmetric (as long as we have plus sign inside)
|
||||
return roundToOdd(Math.min(JBUI.scale(4) * myEditor.getScale(), myEditor.getLineHeight() / 2 - JBUI.scale(2)) * 2);
|
||||
return floorToOdd(Math.min(JBUI.scale(4) * myEditor.getScale(), myEditor.getLineHeight() / 2 - JBUI.scale(2)) * 2);
|
||||
}
|
||||
|
||||
private static int roundToOdd(float f) {
|
||||
private static int floorToOdd(float f) {
|
||||
int res = (int)f;
|
||||
return res % 2 == 0 ? res : res + 1;
|
||||
return res % 2 == 0 && res > 0 ? res : res - 1;
|
||||
}
|
||||
|
||||
public int getFoldingAreaOffset() {
|
||||
|
||||
Reference in New Issue
Block a user