Bug 538973: [ScriptShell] History view does not scroll to the end

  fixed with workaround: make sure to add an additional offset to the
  original calculation

Change-Id: Ifb7ab3b0f7a33ea51efe0a768205fa78e7f01b20
diff --git a/plugins/org.eclipse.ease.ui/src/org/eclipse/ease/ui/view/ScriptHistoryText.java b/plugins/org.eclipse.ease.ui/src/org/eclipse/ease/ui/view/ScriptHistoryText.java
index 54d484c..4da7f0d 100644
--- a/plugins/org.eclipse.ease.ui/src/org/eclipse/ease/ui/view/ScriptHistoryText.java
+++ b/plugins/org.eclipse.ease.ui/src/org/eclipse/ease/ui/view/ScriptHistoryText.java
@@ -227,8 +227,7 @@
 					setStyleRange(styleRange);
 
 					// scroll to end of window
-					setHorizontalPixel(0);
-					setTopPixel(getLineHeight() * getLineCount());
+					scrollToEnd();
 				}
 			});
 		}
@@ -272,13 +271,23 @@
 				setStyleRange(styleRange);
 
 				// scroll to end of window
-				setHorizontalPixel(0);
-				setTopPixel(getLineHeight() * getLineCount());
+				scrollToEnd();
 			}
 		});
 	}
 
 	/**
+	 * Vertically scroll to the end of the history text.
+	 */
+	private void scrollToEnd() {
+		setHorizontalPixel(0);
+		// see https://bugs.eclipse.org/bugs/show_bug.cgi?id=538973
+		// seems the StyledText widget has a strange bug when trying to scroll correctly. we therefore add a factor to the calculated pixel offset to make sure
+		// we correctly scroll to the end.
+		setTopPixel((int) (getLineHeight() * getLineCount() * 1.1));
+	}
+
+	/**
 	 * Get a text representation for the script execution result.
 	 *
 	 * @param result