[Scummvm-git-logs] scummvm master -> 5e467e1bbc67879316a2c4d30d164ce8afc85888

antoniou79 a.antoniou79 at gmail.com
Wed Dec 9 16:56:43 UTC 2020


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

Summary:
5e467e1bbc GRAPHICS: FONT: Clarification for combo of wrapping flags


Commit: 5e467e1bbc67879316a2c4d30d164ce8afc85888
    https://github.com/scummvm/scummvm/commit/5e467e1bbc67879316a2c4d30d164ce8afc85888
Author: antoniou79 (a.antoniou79 at gmail.com)
Date: 2020-12-09T18:53:42+02:00

Commit Message:
GRAPHICS: FONT: Clarification for combo of wrapping flags

for the wordWrapTextImpl and the kWordWrapEvenWidthLines, kWordWrapOnExplicitNewLines bit flags

Changed paths:
    graphics/font.cpp
    graphics/font.h


diff --git a/graphics/font.cpp b/graphics/font.cpp
index 8567c0361f..e2da4f229c 100644
--- a/graphics/font.cpp
+++ b/graphics/font.cpp
@@ -176,9 +176,11 @@ int wordWrapTextImpl(const Font &font, const StringType &str, int maxWidth, Comm
 	// When EvenWidthLines mode is enabled then we require an early loop over the entire string
 	// in order to get the full width of the text
 	//
-	// "Wrap On Explicit New Lines" and "Even Width Lines" modes are mutually exclusive,
-	// If both are set to true and there are new line characters in the text,
-	// then "Even Width Lines" mode is disabled.
+	// If both "Wrap On Explicit New Lines" and "Even Width Lines" modes are set,
+	// and there are new line characters in the text,
+	// then "Wrap On Explicit New Lines" takes precedence and "Even Width Lines" is ignored for that text.
+	// However, if both are set, but there are no new lines in the text,
+	// then the "Even Width Lines" auto-wrapping is applied.
 	//
 	if (mode & kWordWrapEvenWidthLines) {
 		// Early loop to get the full width of the text
diff --git a/graphics/font.h b/graphics/font.h
index 112e0ef2e9..7cff9bfcf1 100644
--- a/graphics/font.h
+++ b/graphics/font.h
@@ -59,7 +59,7 @@ enum TextAlign {
 enum WordWrapMode {
 	kWordWrapDefault			= 0,		///< Default wrapping mode.
 	kWordWrapEvenWidthLines 	= 1 << 0,	///< Make the resulting line segments close to the same width.
-	kWordWrapOnExplicitNewLines	= 1 << 1	///< Text is wrapped on new lines. Otherwise, treats them as single whitespace. Disables kWordWrapEvenWidthLines.
+	kWordWrapOnExplicitNewLines	= 1 << 1	///< Text is wrapped on new lines. Otherwise, treats them as single whitespace.
 };
 
 /**




More information about the Scummvm-git-logs mailing list