From ddfa1e7a1e3b125ab9b071aaf2cdc5ab125eba53 Mon Sep 17 00:00:00 2001 From: Dmitry Batrak Date: Mon, 18 Jun 2018 12:19:54 +0300 Subject: [PATCH] IDEA-104338 folding area clickable area misalignment --- .../openapi/editor/impl/EditorGutterComponentImpl.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/platform/platform-impl/src/com/intellij/openapi/editor/impl/EditorGutterComponentImpl.java b/platform/platform-impl/src/com/intellij/openapi/editor/impl/EditorGutterComponentImpl.java index 0459d3d97126..be9ab884bd7a 100644 --- a/platform/platform-impl/src/com/intellij/openapi/editor/impl/EditorGutterComponentImpl.java +++ b/platform/platform-impl/src/com/intellij/openapi/editor/impl/EditorGutterComponentImpl.java @@ -1425,8 +1425,10 @@ class EditorGutterComponentImpl extends EditorGutterComponentEx implements Mouse Collection displayedAnchors = myAnchorsDisplayStrategy.getAnchorsToDisplay(neighbourhoodStartOffset, neighbourhoodEndOffset, null); + x = convertX(x); for (DisplayedFoldingAnchor anchor : displayedAnchors) { - if (rectangleByFoldOffset(anchor.visualLine, anchorWidth, anchorX).contains(convertX(x), y)) return anchor.foldRegion; + Rectangle r = rectangleByFoldOffset(anchor.visualLine, anchorWidth, anchorX); + if (r.x < x && x <= (r.x + r.width) && r.y < y && y <= (r.y + r.height)) return anchor.foldRegion; } return null;