IDEA-143152 HiDPI on Linux: text caret is too thin by default
authorSergey Simonchik <sergey.simonchik@jetbrains.com>
Mon, 27 Jul 2015 16:33:06 +0000 (19:33 +0300)
committerSergey Simonchik <sergey.simonchik@jetbrains.com>
Mon, 27 Jul 2015 16:33:06 +0000 (19:33 +0300)
platform/platform-impl/src/com/intellij/openapi/editor/impl/EditorImpl.java
platform/platform-impl/src/com/intellij/openapi/editor/impl/view/EditorPainter.java

index 322b4149108bce1e84a034cb199c6daabb39aaf8..86dcb5ee4b9aede38bbc79658f8877ce082a6fb8 100644 (file)
@@ -4799,9 +4799,7 @@ public final class EditorImpl extends UserDataHolderBase implements EditorEx, Hi
           originalG.fillRect(x, y, mySettings.getLineCursorWidth(), lineHeight);
         }
         else {
-          for (int i = 0; i < mySettings.getLineCursorWidth(); i++) {
-            UIUtil.drawLine(g, x + i, y, x + i, y + lineHeight - 1);
-          }
+          g.fillRect(x, y, JBUI.scale(mySettings.getLineCursorWidth()), lineHeight);
         }
       }
       else {
index 6615928f229a45eaeb1e537ba1f827196dd05956..90cdf5ff723210091aec6edee8b49bde9cbc214e 100644 (file)
@@ -654,7 +654,7 @@ class EditorPainter {
       Caret caret = location.myCaret;
       boolean isRtl = location.myIsRtl;
       if (myEditor.isInsertMode() != settings.isBlockCursor()) {
-        int lineWidth = settings.getLineCursorWidth();
+        int lineWidth = JBUI.scale(settings.getLineCursorWidth());
         g.fillRect(x, y, lineWidth, lineHeight);
         if (myDocument.getTextLength() > 0 && caret != null && !myView.getLineLayout(caret.getLogicalPosition().line).isLtr()) {
           g.fillPolygon(new int[]{