[Scummvm-git-logs] scummvm master -> 157b1d9a488d7bfaf4a1fbf7f0caa8c3ce0da31f

rvanlaar noreply at scummvm.org
Fri Feb 17 14:04:14 UTC 2023


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

Summary:
d33005f8b2 JANITORIAL: GRAPHICS: print fgcolor in base 10
157b1d9a48 GRAPHICS: MACGUI: keep formatting in empty text


Commit: d33005f8b2f55d5c412ab32c5f59b3f190a1d68b
    https://github.com/scummvm/scummvm/commit/d33005f8b2f55d5c412ab32c5f59b3f190a1d68b
Author: Roland van Laar (roland at rolandvanlaar.nl)
Date: 2023-02-17T15:02:52+01:00

Commit Message:
JANITORIAL: GRAPHICS: print fgcolor in base 10

All colors in debug output in mactext use base 10
where this line was in base 16.

Changed paths:
    graphics/macgui/mactext.cpp


diff --git a/graphics/macgui/mactext.cpp b/graphics/macgui/mactext.cpp
index df1425425b1..c39a9b53feb 100644
--- a/graphics/macgui/mactext.cpp
+++ b/graphics/macgui/mactext.cpp
@@ -235,7 +235,7 @@ void MacText::init() {
 	if (!colorFontRun.text.empty()) {
 		_fgcolor = colorFontRun.fgcolor;
 		colorFontRun.text.clear();
-		debug(9, "Reading fg color though text, instead of the argument, read %x", _fgcolor);
+		debug(9, "Reading fg color though text, instead of the argument, read %d", _fgcolor);
 		_defaultFormatting = colorFontRun;
 		_defaultFormatting.wm = _wm;
 	}


Commit: 157b1d9a488d7bfaf4a1fbf7f0caa8c3ce0da31f
    https://github.com/scummvm/scummvm/commit/157b1d9a488d7bfaf4a1fbf7f0caa8c3ce0da31f
Author: Roland van Laar (roland at rolandvanlaar.nl)
Date: 2023-02-17T15:02:52+01:00

Commit Message:
GRAPHICS: MACGUI: keep formatting in empty text

When text is emptied by user action, e.g. backspace, the formattting
should be preserved.

In the game Majestic a text box for user input would start out with the
correct formatting, i.e. green text on a black background. When the user
would then press backspace till the text was gone, the method
`MacText::getTextChunk` would return an empty string, with the
formatting removed. If the user started typing again the text would use
the default formatting with black text on black background.

Fixes: https://trello.com/c/POQZRCEO/546-text-doesnt-show-in-majestic-in-text-box

Changed paths:
    graphics/macgui/mactext.cpp


diff --git a/graphics/macgui/mactext.cpp b/graphics/macgui/mactext.cpp
index c39a9b53feb..eeb084db93a 100644
--- a/graphics/macgui/mactext.cpp
+++ b/graphics/macgui/mactext.cpp
@@ -2170,8 +2170,12 @@ Common::U32String MacText::getTextChunk(int startRow, int startCol, int endRow,
 		// We requested only part of one line
 		if (i == startRow && i == endRow) {
 			for (uint chunk = 0; chunk < _textLines[i].chunks.size(); chunk++) {
-				if (_textLines[i].chunks[chunk].text.empty()) // skip empty chunks
+				if (_textLines[i].chunks[chunk].text.empty()) {
+					// skip empty chunks, but keep them formatted,
+					// a text input box needs to keep the formatting even when all text is removed.
+					ADDFORMATTING();
 					continue;
+				}
 
 				if (startCol <= 0) {
 					ADDFORMATTING();




More information about the Scummvm-git-logs mailing list