Browse Source

Fixed a bug in multi-line text rendering.

Lines of text that were exactly filling the target's width went invisible from failing the following safety check.
Dawoodoz 4 years ago
parent
commit
4e0c749c14
1 changed files with 1 additions and 1 deletions
  1. 1 1
      Source/DFPSR/font/Font.cpp

+ 1 - 1
Source/DFPSR/font/Font.cpp

@@ -175,7 +175,7 @@ void RasterFontImpl::printMultiLine(ImageRgbaU8& target, const ReadableString& c
 				}
 				}
 			} else {
 			} else {
 				wordStarted = true;
 				wordStarted = true;
-				if (lineWidth + newCharWidth > bound.width()) {
+				if (lineWidth + newCharWidth >= bound.width()) {
 					int splitIndex = lastWordBreak;
 					int splitIndex = lastWordBreak;
 					if (lastWordBreak == rowStartIndex) {
 					if (lastWordBreak == rowStartIndex) {
 						// The word is too big to be printed as a whole
 						// The word is too big to be printed as a whole