aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugene Sandulenko2017-08-02 22:58:28 +0200
committerEugene Sandulenko2017-08-04 21:54:19 +0200
commitd4207b1e62761d6bc43d3f6078ea5e895b3b09f3 (patch)
tree81f4fd0f10a3141c63bb0a1e7fe9f30113561fac
parent085eea68c36b9d1c3ea55fcdaabd371ec39125f2 (diff)
downloadscummvm-rg350-d4207b1e62761d6bc43d3f6078ea5e895b3b09f3.tar.gz
scummvm-rg350-d4207b1e62761d6bc43d3f6078ea5e895b3b09f3.tar.bz2
scummvm-rg350-d4207b1e62761d6bc43d3f6078ea5e895b3b09f3.zip
GRAPHICS: MACGUI: Implement autoscrolling in MacTextWindow
-rw-r--r--graphics/macgui/mactextwindow.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/graphics/macgui/mactextwindow.cpp b/graphics/macgui/mactextwindow.cpp
index e12a9020d8..8d736d4158 100644
--- a/graphics/macgui/mactextwindow.cpp
+++ b/graphics/macgui/mactextwindow.cpp
@@ -83,6 +83,8 @@ void MacTextWindow::appendText(Common::String str, const MacFont *macFont, bool
_contentIsDirty = true;
+ _scrollPos = MAX(0, _mactext->getTextHeight() - _innerDims.height());
+
updateCursorPos();
}
@@ -137,7 +139,7 @@ bool MacTextWindow::draw(ManagedSurface *g, bool forceRedraw) {
_contentIsDirty = false;
// Compose
- _mactext->draw(&_composeSurface, 0, 0, _surface.w - 2, _surface.h - 2, kConWOverlap - 2, kConWOverlap - 2);
+ _mactext->draw(&_composeSurface, 0, _scrollPos, _surface.w - 2, _scrollPos + _surface.h - 2, kConWOverlap - 2, kConWOverlap - 2);
if (_cursorState)
_composeSurface.blitFrom(*_cursorSurface, *_cursorRect, Common::Point(_cursorX + kConWOverlap, _cursorY + kConHOverlap));