From: Alexey Utkin Date: Mon, 31 Mar 2014 07:56:29 +0000 (+0400) Subject: Fix IDEA-123157 Unnecessary scrolling in Editor Color Dialog (typo fix in line 226... X-Git-Tag: phpstorm/136.1427~9^2~6 X-Git-Url: https://git.jetbrains.org/?p=idea%2Fcommunity.git;a=commitdiff_plain;h=af4bbc3b9871e2b00bf27032af9a0ff21fa138b0 Fix IDEA-123157 Unnecessary scrolling in Editor Color Dialog (typo fix in line 226) +review --- diff --git a/platform/lang-impl/src/com/intellij/application/options/colors/SimpleEditorPreview.java b/platform/lang-impl/src/com/intellij/application/options/colors/SimpleEditorPreview.java index e7e92ca98401..6f54db66fbf8 100644 --- a/platform/lang-impl/src/com/intellij/application/options/colors/SimpleEditorPreview.java +++ b/platform/lang-impl/src/com/intellij/application/options/colors/SimpleEditorPreview.java @@ -133,12 +133,7 @@ public class SimpleEditorPreview implements PreviewPanel{ if (highlighter != null) { HighlighterIterator itr = ((EditorEx)editor).getHighlighter().createIterator(offset); selectItem(itr, highlighter, select); - if (!select) { - ClickNavigator.setCursor(editor, Cursor.HAND_CURSOR); - } - else { - ClickNavigator.setCursor(editor, Cursor.TEXT_CURSOR); - } + ClickNavigator.setCursor(editor, select ? Cursor.TEXT_CURSOR : Cursor.HAND_CURSOR); } } @@ -201,7 +196,7 @@ public class SimpleEditorPreview implements PreviewPanel{ String type = ((EditorSchemeAttributeDescriptor)description).getType(); List highlights = startBlinkingHighlights(myEditor, - myHighlightData, type, + myHighlightData, type, myPage.getHighlighter(), true, myBlinkingAlarm, BLINK_COUNT, myPage); @@ -228,7 +223,7 @@ public class SimpleEditorPreview implements PreviewPanel{ private static boolean isOffsetVisible(final Editor editor, final int startOffset) { Rectangle visibleArea = editor.getScrollingModel().getVisibleArea(); Point point = editor.logicalPositionToXY(editor.offsetToLogicalPosition(startOffset)); - return point.y >= visibleArea.y && point.y < visibleArea.x + visibleArea.height; + return point.y >= visibleArea.y && point.y < (visibleArea.y + visibleArea.height); } private void stopBlinking() {