1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-26 02:15:31 +02:00

Bug 324608 - [terminal] Terminal has strange scrolling behaviour

This commit is contained in:
Martin Oberhuber 2011-05-23 12:19:47 +00:00
parent efe4551f33
commit b05f03a7c8

View file

@ -14,6 +14,7 @@
* Uwe Stieber (Wind River) - [205486] Fix ScrollLock always moving to line 1
* Anton Leherbauer (Wind River) - [219589] Copy an entire line selection
* Anton Leherbauer (Wind River) - [196465] Resizing Terminal changes Scroller location
* Anton Leherbauer (Wind River) - [324608] Terminal has strange scrolling behaviour
*******************************************************************************/
package org.eclipse.tm.internal.terminal.textcanvas;
@ -97,8 +98,10 @@ public class TextCanvas extends GridCanvas {
if(isDisposed())
return;
// scroll to end (unless scroll lock is active)
if (!fResizing)
if (!fResizing) {
calculateGrid();
scrollToEnd();
}
}
});
// let the cursor blink if the text canvas gets the focus...
@ -257,14 +260,16 @@ public class TextCanvas extends GridCanvas {
private void calculateGrid() {
Rectangle virtualBounds = getVirtualBounds();
setVirtualExtend(getCols()*getCellWidth(),getRows()*getCellHeight());
setRedraw(false);
try {
// scroll to end if view port was near last line
Rectangle viewRect = getViewRectangle();
if (virtualBounds.height - (viewRect.y + viewRect.height) < getCellHeight() * 2)
scrollToEnd();
setVirtualExtend(getCols()*getCellWidth(),getRows()*getCellHeight());
getParent().layout();
if (fResizing) {
// scroll to end if view port was near last line
Rectangle viewRect = getViewRectangle();
if (virtualBounds.height - (viewRect.y + viewRect.height) < getCellHeight() * 2)
scrollToEnd();
}
} finally {
setRedraw(true);
}