DFM: take into account folding area and two gaps
authorSergey Ignatov <sergey.ignatov@jetbrains.com>
Thu, 19 Nov 2015 18:06:39 +0000 (21:06 +0300)
committerSergey Ignatov <sergey.ignatov@jetbrains.com>
Thu, 19 Nov 2015 18:06:39 +0000 (21:06 +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 811a28f91ca25bb5b31a193b572e652959e8b3c4..90bd1862449b0b881d2d90a2f0f4c853753c0330 100644 (file)
@@ -701,7 +701,8 @@ 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() + getFoldingAnchorWidth() + 2 * GAP_BETWEEN_AREAS);
+      int centeredSize = (width - rightMarginX - editorLocationX) / 2 - (getLineMarkerAreaWidth() + getLineNumberAreaWidth() + 
+                                                                         getFoldingAreaWidth() + 2 * GAP_BETWEEN_AREAS);
       myTextAnnotationExtraSize = Math.max(0, centeredSize - myTextAnnotationGuttersSize);
     }
   }