IDEA-104338 folding area clickable area misalignment

This commit is contained in:
Dmitry Batrak
2018-06-18 12:20:46 +03:00
parent 1803ed2313
commit ddfa1e7a1e
@@ -1425,8 +1425,10 @@ class EditorGutterComponentImpl extends EditorGutterComponentEx implements Mouse
Collection<DisplayedFoldingAnchor> 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;