From 86d1b1b050a6af5583fb56ad4126d88ea66d3ec7 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Sun, 6 Aug 2017 11:23:23 +0200 Subject: GRAPHICS: MACGUI: Fix cursor position when MacTextWindow is scrolled --- graphics/macgui/mactextwindow.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'graphics') diff --git a/graphics/macgui/mactextwindow.cpp b/graphics/macgui/mactextwindow.cpp index ffb72d9876..854675de98 100644 --- a/graphics/macgui/mactextwindow.cpp +++ b/graphics/macgui/mactextwindow.cpp @@ -142,7 +142,7 @@ bool MacTextWindow::draw(ManagedSurface *g, bool forceRedraw) { _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)); + _composeSurface.blitFrom(*_cursorSurface, *_cursorRect, Common::Point(_cursorX + kConWOverlap - 2, _cursorY + kConHOverlap - 2)); if (_selectedText.endY != -1) drawSelection(); @@ -421,10 +421,7 @@ static void cursorTimerHandler(void *refCon) { } void MacTextWindow::updateCursorPos() { - if (_scrollPos) - _cursorY = _mactext->getTextHeight() - kCursorHeight * 2; - else - _cursorY = _mactext->getTextHeight() - kCursorHeight - 2; + _cursorY = _mactext->getTextHeight() - _scrollPos - kCursorHeight; _cursorDirty = true; } -- cgit v1.2.3