From f8c7cc5706ea00af2424bc4bde628b95ca14e8e4 Mon Sep 17 00:00:00 2001 From: Dmitry Batrak Date: Tue, 26 May 2015 16:26:35 +0300 Subject: [PATCH] IDEA-139761 Incorrect rendering of scrollbar track (following IDEA-CR-2863) --- .../openapi/editor/impl/EditorImpl.java | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/platform/platform-impl/src/com/intellij/openapi/editor/impl/EditorImpl.java b/platform/platform-impl/src/com/intellij/openapi/editor/impl/EditorImpl.java index 0ceed06ffbbe..3070ec362c2a 100644 --- a/platform/platform-impl/src/com/intellij/openapi/editor/impl/EditorImpl.java +++ b/platform/platform-impl/src/com/intellij/openapi/editor/impl/EditorImpl.java @@ -2415,10 +2415,11 @@ public final class EditorImpl extends UserDataHolderBase implements EditorEx, Hi Point position = new Point(0, visibleLine * lineHeight); CharSequence prefixText = myPrefixText == null ? null : new CharArrayCharSequence(myPrefixText); if (clipStartVisualPos.line == 0 && prefixText != null) { - position.x = drawBackground(g, prevBackColor = myPrefixAttributes.getBackgroundColor(), prefixText, 0, prefixText.length(), position, + Color backColor = myPrefixAttributes.getBackgroundColor(); + position.x = drawBackground(g, backColor, prefixText, 0, prefixText.length(), position, myPrefixAttributes.getFontType(), defaultBackground, clip); - + prevBackColor = backColor; } if (clipStartPosition.line >= myDocument.getLineCount() || clipStartPosition.line < 0) { @@ -2469,7 +2470,8 @@ public final class EditorImpl extends UserDataHolderBase implements EditorEx, Hi } if (color != null) { - drawBackground(g, prevBackColor = color, softWrap.getIndentInPixels(), position, defaultBackground, clip); + drawBackground(g, color, softWrap.getIndentInPixels(), position, defaultBackground, clip); + prevBackColor = color; } position.x = softWrap.getIndentInPixels(); } @@ -2525,7 +2527,8 @@ public final class EditorImpl extends UserDataHolderBase implements EditorEx, Hi ); } CharSequence chars = collapsedFolderAt.getPlaceholderText(); - position.x = drawBackground(g, prevBackColor = backColor, chars, 0, chars.length(), position, fontType, defaultBackground, clip); + position.x = drawBackground(g, backColor, chars, 0, chars.length(), position, fontType, defaultBackground, clip); + prevBackColor = backColor; } lIterator.advance(); @@ -2541,7 +2544,8 @@ public final class EditorImpl extends UserDataHolderBase implements EditorEx, Hi ); } CharSequence chars = collapsedFolderAt.getPlaceholderText(); - position.x = drawBackground(g, prevBackColor = backColor, chars, 0, chars.length(), position, fontType, defaultBackground, clip); + position.x = drawBackground(g, backColor, chars, 0, chars.length(), position, fontType, defaultBackground, clip); + prevBackColor = backColor; } else if (hEnd > lEnd - lIterator.getSeparatorLength()) { position.x = drawSoftWrapAwareBackground( @@ -2623,8 +2627,8 @@ public final class EditorImpl extends UserDataHolderBase implements EditorEx, Hi } private int drawSoftWrapAwareBackground(@NotNull Graphics g, - Color backColor, - Color prevBackColor, + @Nullable Color backColor, + @Nullable Color prevBackColor, @NotNull CharSequence text, int start, int end,