DFM: take into account folding area and two gaps
authorSergey Ignatov <sergey.ignatov@jetbrains.com>
Thu, 19 Nov 2015 17:51:03 +0000 (20:51 +0300)
committerSergey Ignatov <sergey.ignatov@jetbrains.com>
Thu, 19 Nov 2015 17:54:39 +0000 (20:54 +0300)
– almost centered editor
– opening the project tool window doesn't shake editor

platform/platform-impl/src/com/intellij/openapi/editor/impl/EditorGutterComponentImpl.java

index 4f6f9e35ff04a623b411d71ee9f1c71358f271f3..811a28f91ca25bb5b31a193b572e652959e8b3c4 100644 (file)
@@ -701,7 +701,7 @@ class EditorGutterComponentImpl extends EditorGutterComponentEx implements Mouse
 
     int width = editorLocationX + editorComponent.getWidth();
     if (rightMarginX < width && editorLocationX < width - rightMarginX) {
-      int centeredSize = (width - rightMarginX - editorLocationX) / 2 - (getLineMarkerAreaWidth() + getLineNumberAreaWidth());
+      int centeredSize = (width - rightMarginX - editorLocationX) / 2 - (getLineMarkerAreaWidth() + getLineNumberAreaWidth() + getFoldingAnchorWidth() + 2 * GAP_BETWEEN_AREAS);
       myTextAnnotationExtraSize = Math.max(0, centeredSize - myTextAnnotationGuttersSize);
     }
   }