[Scummvm-git-logs] scummvm master -> d30e009eff7aedd920a76f963064e381d2e1e6ec

sev- sev at scummvm.org
Sat Jun 12 22:41:34 UTC 2021


This automated email contains information about 9 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
9f4be107a3 DIRECTOR: subtract offsets when we creating text cast member
b0c3ee3e25 DIRECTOR: use _initialRect to create text cast member
e575393e52 GRAPHICS: MACGUI: fix the cursor position calculating in mactext
e18b26d69e GRAPHICS: MACGUI: clean most of the offset in mactext
ce11b8efb9 GRAPHICS: MACGUI: small fix for getRowCol in mactext to suit for new offset system
9f01b08a1b DIRECTOR: wrap up calculating pure text dims of mactext to getTextOnlyDimensions
3693c938e1 DIRECTOR: initialize _selEnd and _selStart when we creating text cast members
9ef28b2acb DIRECTOR: remove 2 offsets when we are creating cast members to avoid keep replacing widget
d30e009eff GRAPHICS: MACGUI: fix regression of scrolling cursor in mactext


Commit: 9f4be107a3334913a1350c64a75fc9734ef82c1d
    https://github.com/scummvm/scummvm/commit/9f4be107a3334913a1350c64a75fc9734ef82c1d
Author: ysj1173886760 (1173886760 at qq.com)
Date: 2021-06-13T00:41:26+02:00

Commit Message:
DIRECTOR: subtract offsets when we creating text cast member

Changed paths:
    engines/director/castmember.cpp
    engines/director/channel.cpp


diff --git a/engines/director/castmember.cpp b/engines/director/castmember.cpp
index 1c5322330e..6ebcd9656f 100644
--- a/engines/director/castmember.cpp
+++ b/engines/director/castmember.cpp
@@ -685,10 +685,22 @@ void TextCastMember::importStxt(const Stxt *stxt) {
 Graphics::MacWidget *TextCastMember::createWidget(Common::Rect &bbox, Channel *channel) {
 	Graphics::MacFont *macFont = new Graphics::MacFont(_fontId, _fontSize, _textSlant);
 	Graphics::MacWidget *widget = nullptr;
+	int w, h;
 
 	switch (_type) {
 	case kCastText:
-		widget = new Graphics::MacText(g_director->getCurrentWindow(), bbox.left, bbox.top, bbox.width(), bbox.height(), g_director->_wm, _ftext, macFont, getForeColor(), getBackColor(), bbox.width(), getAlignment(), 0, _borderSize, _gutterSize, _boxShadow, _textShadow);
+		// since mactext will add some offsets itself, then we calculate it first, to make sure the result size is the same as bbox
+		// formula comes from the ctor of macwidget and mactext
+		//	_dims.left = x;
+		//	_dims.right = x + w + (2 * border) + (2 * gutter) + shadow;
+		//	_dims.top = y;
+		//	_dims.bottom = y + h + (2 * border) + gutter + shadow;
+		// x, y, w + 2, h
+		w = bbox.right - bbox.left - 2 * _borderSize - 2 * _gutterSize - _boxShadow;
+		h = bbox.bottom - bbox.top - 2 * _borderSize - _gutterSize - _boxShadow;
+		w -= 2;
+
+		widget = new Graphics::MacText(g_director->getCurrentWindow(), bbox.left, bbox.top, w, h, g_director->_wm, _ftext, macFont, getForeColor(), getBackColor(), w, getAlignment(), 0, _borderSize, _gutterSize, _boxShadow, _textShadow);
 		((Graphics::MacText *)widget)->draw();
 		((Graphics::MacText *)widget)->_focusable = _editable;
 		((Graphics::MacText *)widget)->setEditable(_editable);
diff --git a/engines/director/channel.cpp b/engines/director/channel.cpp
index f0ec1e4036..a485fc3f98 100644
--- a/engines/director/channel.cpp
+++ b/engines/director/channel.cpp
@@ -396,7 +396,6 @@ void Channel::replaceWidget() {
 			_widget->_priority = _priority;
 			_widget->draw();
 
-			// HACK: Account for the added dimensions for borders, etc.
 			if (_sprite->_cast->_type == kCastText || _sprite->_cast->_type == kCastButton) {
 				_sprite->_width = _widget->_dims.width();
 				_sprite->_height = _widget->_dims.height();


Commit: b0c3ee3e2593db6f3302c1d86058821d071d56c0
    https://github.com/scummvm/scummvm/commit/b0c3ee3e2593db6f3302c1d86058821d071d56c0
Author: ysj1173886760 (1173886760 at qq.com)
Date: 2021-06-13T00:41:26+02:00

Commit Message:
DIRECTOR: use _initialRect to create text cast member

Changed paths:
    engines/director/castmember.cpp


diff --git a/engines/director/castmember.cpp b/engines/director/castmember.cpp
index 6ebcd9656f..39b1211b30 100644
--- a/engines/director/castmember.cpp
+++ b/engines/director/castmember.cpp
@@ -696,9 +696,12 @@ Graphics::MacWidget *TextCastMember::createWidget(Common::Rect &bbox, Channel *c
 		//	_dims.top = y;
 		//	_dims.bottom = y + h + (2 * border) + gutter + shadow;
 		// x, y, w + 2, h
-		w = bbox.right - bbox.left - 2 * _borderSize - 2 * _gutterSize - _boxShadow;
-		h = bbox.bottom - bbox.top - 2 * _borderSize - _gutterSize - _boxShadow;
-		w -= 2;
+		// use the initialRect for the dims just like CastButton
+		w = _initialRect.right - _initialRect.left - 2 * _borderSize - 2 * _gutterSize - _boxShadow;
+		h = _initialRect.bottom - _initialRect.top - 2 * _borderSize - _gutterSize - _boxShadow;
+		h += 2;
+		// this number 2 is a little bit complex, i found the size of _initialRect and bbox are smaller than the parameter in original director
+		// offsets is 2, so we need add it back. i.e. w += 2, h += 2. And we have w + 2 at the same time, thus, we only need to do h += 2
 
 		widget = new Graphics::MacText(g_director->getCurrentWindow(), bbox.left, bbox.top, w, h, g_director->_wm, _ftext, macFont, getForeColor(), getBackColor(), w, getAlignment(), 0, _borderSize, _gutterSize, _boxShadow, _textShadow);
 		((Graphics::MacText *)widget)->draw();


Commit: e575393e5286cad0d73085289b8bf41e1c179561
    https://github.com/scummvm/scummvm/commit/e575393e5286cad0d73085289b8bf41e1c179561
Author: ysj1173886760 (1173886760 at qq.com)
Date: 2021-06-13T00:41:26+02:00

Commit Message:
GRAPHICS: MACGUI: fix the cursor position calculating in mactext

Changed paths:
    graphics/macgui/mactext.cpp


diff --git a/graphics/macgui/mactext.cpp b/graphics/macgui/mactext.cpp
index 9b5ed34781..92e9b4f07b 100644
--- a/graphics/macgui/mactext.cpp
+++ b/graphics/macgui/mactext.cpp
@@ -1069,7 +1069,7 @@ bool MacText::draw(bool forceRedraw) {
 	Common::Point offset(calculateOffset());
 
 	if (!_cursorState)
-		_composeSurface->blitFrom(*_cursorSurface2, *_cursorRect, Common::Point(_cursorX, _cursorY + offset.y + 1));
+		_composeSurface->blitFrom(*_cursorSurface2, *_cursorRect, Common::Point(_cursorX, _cursorY));
 
 	draw(_composeSurface, 0, _scrollPos, _surface->w, _scrollPos + _surface->h, offset.x, offset.y);
 
@@ -1085,7 +1085,7 @@ bool MacText::draw(bool forceRedraw) {
 
 	// if we are drawing the selection text or we are selecting, then we don't draw the cursor
 	if (_cursorState && !((_inTextSelection || _selectedText.endY != -1) && _active))
-		_composeSurface->blitFrom(*_cursorSurface, *_cursorRect, Common::Point(_cursorX, _cursorY + offset.y + 1));
+		_composeSurface->blitFrom(*_cursorSurface, *_cursorRect, Common::Point(_cursorX, _cursorY));
 
 	if (_selectedText.endY != -1)
 		drawSelection(offset.x, offset.y);
@@ -2114,7 +2114,7 @@ void MacText::updateCursorPos() {
 		else if (_textAlignment == kTextAlignCenter)
 			alignOffset = (_textMaxWidth / 2) - (getLineWidth(_cursorRow) / 2);
 
-		_cursorY = _textLines[_cursorRow].y + offset.y - 2 - _scrollPos;
+		_cursorY = _textLines[_cursorRow].y + offset.y - _scrollPos + 1;
 		_cursorX = getLineWidth(_cursorRow, false, _cursorCol) + alignOffset + offset.x - 1;
 	}
 
@@ -2135,7 +2135,7 @@ void MacText::undrawCursor() {
 	_cursorDirty = true;
 
 	Common::Point offset(calculateOffset());
-	_composeSurface->blitFrom(*_cursorSurface2, *_cursorRect, Common::Point(_cursorX, _cursorY + offset.y + 1));
+	_composeSurface->blitFrom(*_cursorSurface2, *_cursorRect, Common::Point(_cursorX, _cursorY));
 }
 
 } // End of namespace Graphics


Commit: e18b26d69e914e87e53eab3db49ec3bfe914f805
    https://github.com/scummvm/scummvm/commit/e18b26d69e914e87e53eab3db49ec3bfe914f805
Author: ysj1173886760 (1173886760 at qq.com)
Date: 2021-06-13T00:41:26+02:00

Commit Message:
GRAPHICS: MACGUI: clean most of the offset in mactext

Changed paths:
    graphics/macgui/mactext.cpp


diff --git a/graphics/macgui/mactext.cpp b/graphics/macgui/mactext.cpp
index 92e9b4f07b..e2eb7e0358 100644
--- a/graphics/macgui/mactext.cpp
+++ b/graphics/macgui/mactext.cpp
@@ -1030,7 +1030,7 @@ void MacText::draw(ManagedSurface *g, int x, int y, int w, int h, int xoff, int
 	render();
 
 	if (x + w < _surface->w || y + h < _surface->h)
-		g->fillRect(Common::Rect(x, y, x + w, y + h), _bgcolor);
+		g->fillRect(Common::Rect(x + xoff, y + yoff, x + w + xoff, y + h + yoff), _bgcolor);
 
 	g->blitFrom(*_surface, Common::Rect(MIN<int>(_surface->w, x), MIN<int>(_surface->h, y), MIN<int>(_surface->w, x + w), MIN<int>(_surface->h, y + h)), Common::Point(xoff, yoff));
 
@@ -1069,7 +1069,7 @@ bool MacText::draw(bool forceRedraw) {
 	Common::Point offset(calculateOffset());
 
 	if (!_cursorState)
-		_composeSurface->blitFrom(*_cursorSurface2, *_cursorRect, Common::Point(_cursorX, _cursorY));
+		_composeSurface->blitFrom(*_cursorSurface2, *_cursorRect, Common::Point(_cursorX + offset.x - 1, _cursorY + offset.y + 1));
 
 	draw(_composeSurface, 0, _scrollPos, _surface->w, _scrollPos + _surface->h, offset.x, offset.y);
 
@@ -1085,7 +1085,7 @@ bool MacText::draw(bool forceRedraw) {
 
 	// if we are drawing the selection text or we are selecting, then we don't draw the cursor
 	if (_cursorState && !((_inTextSelection || _selectedText.endY != -1) && _active))
-		_composeSurface->blitFrom(*_cursorSurface, *_cursorRect, Common::Point(_cursorX, _cursorY));
+		_composeSurface->blitFrom(*_cursorSurface, *_cursorRect, Common::Point(_cursorX + offset.x - 1, _cursorY + offset.y + 1));
 
 	if (_selectedText.endY != -1)
 		drawSelection(offset.x, offset.y);
@@ -1465,7 +1465,7 @@ bool MacText::processEvent(Common::Event &event) {
 
 			_cursorRow--;
 
-			getRowCol(_cursorX + 1, _textLines[_cursorRow].y, nullptr, nullptr, &_cursorRow, &_cursorCol);
+			getRowCol(_cursorX, _textLines[_cursorRow].y, nullptr, nullptr, &_cursorRow, &_cursorCol);
 			updateCursorPos();
 
 			return true;
@@ -1476,7 +1476,7 @@ bool MacText::processEvent(Common::Event &event) {
 
 			_cursorRow++;
 
-			getRowCol(_cursorX + 1, _textLines[_cursorRow].y, nullptr, nullptr, &_cursorRow, &_cursorCol);
+			getRowCol(_cursorX, _textLines[_cursorRow].y, nullptr, nullptr, &_cursorRow, &_cursorCol);
 			updateCursorPos();
 
 			return true;
@@ -1558,8 +1558,9 @@ bool MacText::processEvent(Common::Event &event) {
 				if (_menu)
 					_menu->enableCommand("Edit", "Copy", false);
 
-				int x = event.mouse.x - getDimensions().left;
-				int y = event.mouse.y - getDimensions().top + _scrollPos;
+				Common::Point offset = calculateOffset();
+				int x = event.mouse.x - getDimensions().left - offset.x;
+				int y = event.mouse.y - getDimensions().top + _scrollPos - offset.y;
 
 				getRowCol(x, y, nullptr, nullptr, &_cursorRow, &_cursorCol);
 				updateCursorPos();
@@ -1605,8 +1606,9 @@ void MacText::startMarking(int x, int y) {
 	if (_textLines.size() == 0)
 		return;
 
-	x -= getDimensions().left - 2;
-	y -= getDimensions().top;
+	Common::Point offset = calculateOffset();
+	x -= getDimensions().left - offset.x;
+	y -= getDimensions().top - offset.y;
 
 	y += _scrollPos;
 
@@ -1618,8 +1620,9 @@ void MacText::startMarking(int x, int y) {
 }
 
 void MacText::updateTextSelection(int x, int y) {
-	x -= getDimensions().left - 2;
-	y -= getDimensions().top;
+	Common::Point offset = calculateOffset();
+	x -= getDimensions().left - offset.x;
+	y -= getDimensions().top - offset.y;
 
 	y += _scrollPos;
 
@@ -2106,16 +2109,14 @@ void MacText::updateCursorPos() {
 
 		_cursorRow = MIN<int>(_cursorRow, _textLines.size() - 1);
 
-		Common::Point offset(calculateOffset());
-
 		int alignOffset = 0;
 		if (_textAlignment == kTextAlignRight)
 			alignOffset = _textMaxWidth - getLineWidth(_cursorRow);
 		else if (_textAlignment == kTextAlignCenter)
 			alignOffset = (_textMaxWidth / 2) - (getLineWidth(_cursorRow) / 2);
 
-		_cursorY = _textLines[_cursorRow].y + offset.y - _scrollPos + 1;
-		_cursorX = getLineWidth(_cursorRow, false, _cursorCol) + alignOffset + offset.x - 1;
+		_cursorY = _textLines[_cursorRow].y;
+		_cursorX = getLineWidth(_cursorRow, false, _cursorCol) + alignOffset;
 	}
 
 	int cursorHeight = getLineHeight(_cursorRow);
@@ -2135,7 +2136,7 @@ void MacText::undrawCursor() {
 	_cursorDirty = true;
 
 	Common::Point offset(calculateOffset());
-	_composeSurface->blitFrom(*_cursorSurface2, *_cursorRect, Common::Point(_cursorX, _cursorY));
+	_composeSurface->blitFrom(*_cursorSurface2, *_cursorRect, Common::Point(_cursorX + offset.x - 1, _cursorY + offset.y + 1));
 }
 
 } // End of namespace Graphics


Commit: ce11b8efb9e767dd6b3007ea032644d4f20fcf69
    https://github.com/scummvm/scummvm/commit/ce11b8efb9e767dd6b3007ea032644d4f20fcf69
Author: ysj1173886760 (1173886760 at qq.com)
Date: 2021-06-13T00:41:26+02:00

Commit Message:
GRAPHICS: MACGUI: small fix for getRowCol in mactext to suit for new offset system

Changed paths:
    graphics/macgui/mactext.cpp


diff --git a/graphics/macgui/mactext.cpp b/graphics/macgui/mactext.cpp
index e2eb7e0358..ace03b740c 100644
--- a/graphics/macgui/mactext.cpp
+++ b/graphics/macgui/mactext.cpp
@@ -1693,7 +1693,7 @@ void MacText::getRowCol(int x, int y, int *sx, int *sy, int *row, int *col) {
 
 	for (int i = str.size(); i >= 0; i--) {
 		int strw = _textLines[nrow].chunks[chunk].getFont()->getStringWidth(str);
-		if (strw + pwidth + alignOffset < x) {
+		if (strw + pwidth + alignOffset <= x) {
 			ncol = pmcol + i;
 			nsx = strw + pwidth;
 			break;


Commit: 9f01b08a1b00bec4788299e63d04275cd533e8c6
    https://github.com/scummvm/scummvm/commit/9f01b08a1b00bec4788299e63d04275cd533e8c6
Author: ysj1173886760 (1173886760 at qq.com)
Date: 2021-06-13T00:41:26+02:00

Commit Message:
DIRECTOR: wrap up calculating pure text dims of mactext to getTextOnlyDimensions

Changed paths:
    engines/director/castmember.cpp
    engines/director/castmember.h


diff --git a/engines/director/castmember.cpp b/engines/director/castmember.cpp
index 39b1211b30..5d38400242 100644
--- a/engines/director/castmember.cpp
+++ b/engines/director/castmember.cpp
@@ -682,28 +682,33 @@ void TextCastMember::importStxt(const Stxt *stxt) {
 	_ptext = stxt->_ptext;
 }
 
+// calculate text dimensions in mactext
+// formula comes from the ctor of macwidget and mactext
+//	_dims.left = x;
+//	_dims.right = x + w + (2 * border) + (2 * gutter) + shadow;
+//	_dims.top = y;
+//	_dims.bottom = y + h + (2 * border) + gutter + shadow;
+// x, y, w + 2, h
+// this number 2 is a little bit complex. I found the size of _initialRect and bbox are smaller than the parameter in original director
+// offsets is 2, so we need add it back. i.e. w += 2, h += 2. And we have w + 2 at the same time, thus, we only need to do h += 2
+Common::Rect TextCastMember::getTextOnlyDimensions(const Common::Rect &targetDims) {
+	int w = targetDims.right - targetDims.left - 2 * _borderSize - 2 * _gutterSize - _boxShadow;
+	int h = targetDims.bottom - targetDims.top - 2 * _borderSize - _gutterSize - _boxShadow;
+	h += 2;
+	return Common::Rect(w, h);
+}
+
 Graphics::MacWidget *TextCastMember::createWidget(Common::Rect &bbox, Channel *channel) {
 	Graphics::MacFont *macFont = new Graphics::MacFont(_fontId, _fontSize, _textSlant);
 	Graphics::MacWidget *widget = nullptr;
-	int w, h;
+	Common::Rect dims;
 
 	switch (_type) {
 	case kCastText:
 		// since mactext will add some offsets itself, then we calculate it first, to make sure the result size is the same as bbox
-		// formula comes from the ctor of macwidget and mactext
-		//	_dims.left = x;
-		//	_dims.right = x + w + (2 * border) + (2 * gutter) + shadow;
-		//	_dims.top = y;
-		//	_dims.bottom = y + h + (2 * border) + gutter + shadow;
-		// x, y, w + 2, h
 		// use the initialRect for the dims just like CastButton
-		w = _initialRect.right - _initialRect.left - 2 * _borderSize - 2 * _gutterSize - _boxShadow;
-		h = _initialRect.bottom - _initialRect.top - 2 * _borderSize - _gutterSize - _boxShadow;
-		h += 2;
-		// this number 2 is a little bit complex, i found the size of _initialRect and bbox are smaller than the parameter in original director
-		// offsets is 2, so we need add it back. i.e. w += 2, h += 2. And we have w + 2 at the same time, thus, we only need to do h += 2
-
-		widget = new Graphics::MacText(g_director->getCurrentWindow(), bbox.left, bbox.top, w, h, g_director->_wm, _ftext, macFont, getForeColor(), getBackColor(), w, getAlignment(), 0, _borderSize, _gutterSize, _boxShadow, _textShadow);
+		dims = getTextOnlyDimensions(_initialRect);
+		widget = new Graphics::MacText(g_director->getCurrentWindow(), bbox.left, bbox.top, dims.width(), dims.height(), g_director->_wm, _ftext, macFont, getForeColor(), getBackColor(), dims.width(), getAlignment(), 0, _borderSize, _gutterSize, _boxShadow, _textShadow);
 		((Graphics::MacText *)widget)->draw();
 		((Graphics::MacText *)widget)->_focusable = _editable;
 		((Graphics::MacText *)widget)->setEditable(_editable);
diff --git a/engines/director/castmember.h b/engines/director/castmember.h
index e78f60b838..53254f1968 100644
--- a/engines/director/castmember.h
+++ b/engines/director/castmember.h
@@ -255,6 +255,8 @@ public:
 	Common::String getText();
 
 private:
+	Common::Rect getTextOnlyDimensions(const Common::Rect &targetDims);
+
 	uint32 _bgcolor;
 	uint32 _fgcolor;
 };


Commit: 3693c938e1172c740536451a49d9a2d5e17a59ee
    https://github.com/scummvm/scummvm/commit/3693c938e1172c740536451a49d9a2d5e17a59ee
Author: ysj1173886760 (1173886760 at qq.com)
Date: 2021-06-13T00:41:26+02:00

Commit Message:
DIRECTOR: initialize _selEnd and _selStart when we creating text cast members

Changed paths:
    engines/director/castmember.cpp


diff --git a/engines/director/castmember.cpp b/engines/director/castmember.cpp
index 5d38400242..1bdaf7f4b5 100644
--- a/engines/director/castmember.cpp
+++ b/engines/director/castmember.cpp
@@ -709,6 +709,7 @@ Graphics::MacWidget *TextCastMember::createWidget(Common::Rect &bbox, Channel *c
 		// use the initialRect for the dims just like CastButton
 		dims = getTextOnlyDimensions(_initialRect);
 		widget = new Graphics::MacText(g_director->getCurrentWindow(), bbox.left, bbox.top, dims.width(), dims.height(), g_director->_wm, _ftext, macFont, getForeColor(), getBackColor(), dims.width(), getAlignment(), 0, _borderSize, _gutterSize, _boxShadow, _textShadow);
+		((Graphics::MacText *)widget)->setSelRange(g_director->getCurrentMovie()->_selStart, g_director->getCurrentMovie()->_selEnd);
 		((Graphics::MacText *)widget)->draw();
 		((Graphics::MacText *)widget)->_focusable = _editable;
 		((Graphics::MacText *)widget)->setEditable(_editable);


Commit: 9ef28b2acb731ec84f957cbdac3329b5198e0c58
    https://github.com/scummvm/scummvm/commit/9ef28b2acb731ec84f957cbdac3329b5198e0c58
Author: ysj1173886760 (1173886760 at qq.com)
Date: 2021-06-13T00:41:26+02:00

Commit Message:
DIRECTOR: remove 2 offsets when we are creating cast members to avoid keep replacing widget

Changed paths:
    engines/director/castmember.cpp


diff --git a/engines/director/castmember.cpp b/engines/director/castmember.cpp
index 1bdaf7f4b5..fdc3555011 100644
--- a/engines/director/castmember.cpp
+++ b/engines/director/castmember.cpp
@@ -689,12 +689,10 @@ void TextCastMember::importStxt(const Stxt *stxt) {
 //	_dims.top = y;
 //	_dims.bottom = y + h + (2 * border) + gutter + shadow;
 // x, y, w + 2, h
-// this number 2 is a little bit complex. I found the size of _initialRect and bbox are smaller than the parameter in original director
-// offsets is 2, so we need add it back. i.e. w += 2, h += 2. And we have w + 2 at the same time, thus, we only need to do h += 2
 Common::Rect TextCastMember::getTextOnlyDimensions(const Common::Rect &targetDims) {
 	int w = targetDims.right - targetDims.left - 2 * _borderSize - 2 * _gutterSize - _boxShadow;
 	int h = targetDims.bottom - targetDims.top - 2 * _borderSize - _gutterSize - _boxShadow;
-	h += 2;
+	w -= 2;
 	return Common::Rect(w, h);
 }
 
@@ -706,7 +704,7 @@ Graphics::MacWidget *TextCastMember::createWidget(Common::Rect &bbox, Channel *c
 	switch (_type) {
 	case kCastText:
 		// since mactext will add some offsets itself, then we calculate it first, to make sure the result size is the same as bbox
-		// use the initialRect for the dims just like CastButton
+		// use the initialRect for the dims, (seems like initialRect is same as bbox since we once called setCast)
 		dims = getTextOnlyDimensions(_initialRect);
 		widget = new Graphics::MacText(g_director->getCurrentWindow(), bbox.left, bbox.top, dims.width(), dims.height(), g_director->_wm, _ftext, macFont, getForeColor(), getBackColor(), dims.width(), getAlignment(), 0, _borderSize, _gutterSize, _boxShadow, _textShadow);
 		((Graphics::MacText *)widget)->setSelRange(g_director->getCurrentMovie()->_selStart, g_director->getCurrentMovie()->_selEnd);


Commit: d30e009eff7aedd920a76f963064e381d2e1e6ec
    https://github.com/scummvm/scummvm/commit/d30e009eff7aedd920a76f963064e381d2e1e6ec
Author: ysj1173886760 (1173886760 at qq.com)
Date: 2021-06-13T00:41:26+02:00

Commit Message:
GRAPHICS: MACGUI: fix regression of scrolling cursor in mactext

Changed paths:
    graphics/macgui/mactext.cpp


diff --git a/graphics/macgui/mactext.cpp b/graphics/macgui/mactext.cpp
index ace03b740c..f8e1f73d45 100644
--- a/graphics/macgui/mactext.cpp
+++ b/graphics/macgui/mactext.cpp
@@ -2115,7 +2115,7 @@ void MacText::updateCursorPos() {
 		else if (_textAlignment == kTextAlignCenter)
 			alignOffset = (_textMaxWidth / 2) - (getLineWidth(_cursorRow) / 2);
 
-		_cursorY = _textLines[_cursorRow].y;
+		_cursorY = _textLines[_cursorRow].y - _scrollPos;
 		_cursorX = getLineWidth(_cursorRow, false, _cursorCol) + alignOffset;
 	}
 




More information about the Scummvm-git-logs mailing list