From 6dc89de91d46447685a1a12b5c7699bbce08b683 Mon Sep 17 00:00:00 2001 From: Felipe Heidrich Date: Tue, 18 Oct 2011 14:12:48 -0400 Subject: Bug 361189 - StyledText vertical scroll bar won't scroll to the end of the text --- .../common/org/eclipse/swt/custom/StyledText.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'bundles/org.eclipse.swt/Eclipse SWT Custom Widgets') diff --git a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/StyledText.java b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/StyledText.java index b268b8ec3c..852816035f 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/StyledText.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/StyledText.java @@ -1615,8 +1615,11 @@ void calculateTopIndex(int delta) { } } if (topIndex != oldTopIndex || oldTopIndexY != topIndexY) { + int width = renderer.getWidth(); renderer.calculateClientArea(); - setScrollBars(false); + if (width != renderer.getWidth()) { + setScrollBars(false); + } } } /** @@ -9334,7 +9337,7 @@ void setScrollBars(boolean vertical) { } if (horizontalBar != null) { setScrollBar(horizontalBar, clientAreaWidth, renderer.getWidth(), leftMargin + rightMargin); - if (!alwaysShowScroll && horizontalBar.getVisible() && verticalBar != null && !verticalBar.getVisible()) { + if (!alwaysShowScroll && horizontalBar.getVisible() && verticalBar != null) { setScrollBar(verticalBar, clientAreaHeight, renderer.getHeight(), topMargin + bottomMargin); } } -- cgit