From 85db38d318ad7edec545544eb6effc80a4a62867 Mon Sep 17 00:00:00 2001 From: Dmitry Batrak Date: Thu, 19 Mar 2015 15:24:09 +0300 Subject: [PATCH] IDEA-137353 Sometimes it is hard to set a breakpoint on the gutter --- .../editor/impl/EditorGutterComponentImpl.java | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) 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 c67654610b0c..1539a8715a53 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 @@ -78,6 +78,7 @@ class EditorGutterComponentImpl extends EditorGutterComponentEx implements Mouse private static final Logger LOG = Logger.getInstance("#com.intellij.openapi.editor.impl.EditorGutterComponentImpl"); private static final int START_ICON_AREA_WIDTH = 15; private static final int FREE_PAINTERS_AREA_WIDTH = 5; + private static final int GAP_BETWEEN_ICONS_AND_FREE_PAINTERS_AREA = 5; private static final int GAP_BETWEEN_ICONS = 3; private static final int GAP_BEFORE_LINE_NUMBERS = 5; private static final int GAP_AFTER_LINE_NUMBERS = 4; @@ -91,7 +92,7 @@ class EditorGutterComponentImpl extends EditorGutterComponentEx implements Mouse private final EditorImpl myEditor; private final FoldingAnchorsOverlayStrategy myAnchorsDisplayStrategy; - private int myLineMarkerAreaWidth = START_ICON_AREA_WIDTH + FREE_PAINTERS_AREA_WIDTH; + private int myLineMarkerAreaWidth = START_ICON_AREA_WIDTH + GAP_BETWEEN_ICONS_AND_FREE_PAINTERS_AREA + FREE_PAINTERS_AREA_WIDTH; private int myIconsAreaWidth = START_ICON_AREA_WIDTH; private int myLineNumberAreaWidth = 0; private int myAdditionalLineNumberAreaWidth = 0; @@ -215,8 +216,8 @@ class EditorGutterComponentImpl extends EditorGutterComponentEx implements Mouse int lastVisibleOffset = myEditor.logicalPositionToOffset(myEditor.xyToLogicalPosition(new Point(0, clip.y + clip.height + myEditor.getLineHeight()))); paintFoldingBackground(g, clip, backgroundColor); paintLineMarkersBackground(g, clip, backgroundColor); - paintBackground(g, clip, getLineMarkerAreaOffset(), getLineMarkerAreaWidth(), backgroundColor); paintEditorBackgrounds(g, firstVisibleOffset, lastVisibleOffset); + paintAnnotations(g, clip); paintLineMarkers(g, firstVisibleOffset, lastVisibleOffset); paintFoldingLines((Graphics2D)g, clip); @@ -688,7 +689,7 @@ class EditorGutterComponentImpl extends EditorGutterComponentEx implements Mouse } }); - myLineMarkerAreaWidth = myIconsAreaWidth + FREE_PAINTERS_AREA_WIDTH; + myLineMarkerAreaWidth = myIconsAreaWidth + GAP_BETWEEN_ICONS_AND_FREE_PAINTERS_AREA + FREE_PAINTERS_AREA_WIDTH; } private boolean isHighlighterVisible(RangeHighlighter highlighter) { @@ -780,7 +781,7 @@ class EditorGutterComponentImpl extends EditorGutterComponentEx implements Mouse int height = endY - startY; int w = FREE_PAINTERS_AREA_WIDTH; - int x = getLineMarkerAreaOffset() + myIconsAreaWidth - 1; + int x = getLineMarkerFreePaintersAreaOffset() - 1; return new Rectangle(x, startY, w, height); } @@ -1141,6 +1142,10 @@ class EditorGutterComponentImpl extends EditorGutterComponentEx implements Mouse return getAnnotationsAreaOffset() + getAnnotationsAreaWidthEx(); } + private int getLineMarkerFreePaintersAreaOffset() { + return getLineMarkerAreaOffset() + myIconsAreaWidth + GAP_BETWEEN_ICONS_AND_FREE_PAINTERS_AREA; + } + @Override public int getIconsAreaWidth() { return myIconsAreaWidth; @@ -1364,7 +1369,7 @@ class EditorGutterComponentImpl extends EditorGutterComponentEx implements Mouse if (findFoldingAnchorAt(e.getX(), e.getY()) != null) { return null; } - if (e.isConsumed() || e.getX() > getWhitespaceSeparatorOffset()) { + if (e.isConsumed() || e.getX() > getWhitespaceSeparatorOffset() || e.getX() < getLineMarkerFreePaintersAreaOffset()) { return null; } final ActiveGutterRenderer[] gutterRenderer = {null};