Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Keller2016-04-13 22:00:50 +0000
committerMarkus Keller2016-04-13 22:01:14 +0000
commitb8aad5a47e813827433aa4e688c2d1cd41dc3de7 (patch)
tree7bd518eae1e29f86018c537c557da371bf9228b5
parente4c6b510344ca7b6b3fbf687fb55addfb4b7ba40 (diff)
downloadeclipse.platform.text-b8aad5a47e813827433aa4e688c2d1cd41dc3de7.tar.gz
eclipse.platform.text-b8aad5a47e813827433aa4e688c2d1cd41dc3de7.tar.xz
eclipse.platform.text-b8aad5a47e813827433aa4e688c2d1cd41dc3de7.zip
Bug 485540: [rulers] Annotations in overview ruler scale incorrectly in regards to scrollbar thumbY20160414-1000I20160419-0800I20160417-1112
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/source/SourceViewer.java11
1 files changed, 7 insertions, 4 deletions
diff --git a/org.eclipse.jface.text/src/org/eclipse/jface/text/source/SourceViewer.java b/org.eclipse.jface.text/src/org/eclipse/jface/text/source/SourceViewer.java
index f8448a7c318..99eb3f5766b 100644
--- a/org.eclipse.jface.text/src/org/eclipse/jface/text/source/SourceViewer.java
+++ b/org.eclipse.jface.text/src/org/eclipse/jface/text/source/SourceViewer.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2015 IBM Corporation and others.
+ * Copyright (c) 2000, 2016 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -189,7 +189,7 @@ public class SourceViewer extends TextViewer implements ISourceViewer, ISourceVi
*/
private int[] getVerticalScrollArrowHeights(StyledText textWidget, int bottomOffset) {
ScrollBar verticalBar= textWidget.getVerticalBar();
- if (verticalBar == null || !verticalBar.isVisible())
+ if (verticalBar == null || !verticalBar.getVisible())
return new int[] { 0, 0 };
int[] arrowHeights= computeScrollArrowHeights(textWidget, bottomOffset);
@@ -203,7 +203,7 @@ public class SourceViewer extends TextViewer implements ISourceViewer, ISourceVi
try {
int fakeHeight= 1000;
bottomOffset= bottomOffset - originalSize.y + fakeHeight;
- textWidget.setSize(originalSize.x, fakeHeight);
+ textWidget.setSize(originalSize.x + 100, fakeHeight);
verticalBar.setValues(0, 0, 1 << 30, 1, 10, 10);
arrowHeights= computeScrollArrowHeights(textWidget, bottomOffset);
fScrollArrowHeights= arrowHeights;
@@ -226,8 +226,11 @@ public class SourceViewer extends TextViewer implements ISourceViewer, ISourceVi
private int[] computeScrollArrowHeights(StyledText textWidget, int bottomOffset) {
ScrollBar verticalBar= textWidget.getVerticalBar();
Rectangle thumbTrackBounds= verticalBar.getThumbTrackBounds();
- if (thumbTrackBounds.height == 0) // SWT returns bogus values on Cocoa in this case, see https://bugs.eclipse.org/352990
+ if (thumbTrackBounds.height == 0) {
+ // SWT returns bogus values on Cocoa in this case, see https://bugs.eclipse.org/352990
+ // SWT returns bogus values on Windows when the control is too small, see https://bugs.eclipse.org/485540
return new int[] { 0, 0 };
+ }
int topArrowHeight= thumbTrackBounds.y;
int bottomArrowHeight= bottomOffset - (thumbTrackBounds.y + thumbTrackBounds.height);

Back to the top