summary refs log tree commit diff stats
path: root/src/message_system.cpp
diff options
context:
space:
mode:
authorKelly Rauchenberger <fefferburbia@gmail.com>2021-02-06 13:39:02 -0500
committerKelly Rauchenberger <fefferburbia@gmail.com>2021-02-06 13:39:02 -0500
commitcb7617344c3b7994cb40d6253a77dbfa3d3ff984 (patch)
treebf7e533250b82286878424dc2573e106b4518b73 /src/message_system.cpp
parent6d6e03b95b197d3a16b629131d463263b46c1e42 (diff)
downloadtanetane-cb7617344c3b7994cb40d6253a77dbfa3d3ff984.tar.gz
tanetane-cb7617344c3b7994cb40d6253a77dbfa3d3ff984.tar.bz2
tanetane-cb7617344c3b7994cb40d6253a77dbfa3d3ff984.zip
Fixed text wrapping miscalculation issue
Diffstat (limited to 'src/message_system.cpp')
-rw-r--r--src/message_system.cpp8
1 files changed, 1 insertions, 7 deletions
diff --git a/src/message_system.cpp b/src/message_system.cpp index 4a31a69..f9803ed 100644 --- a/src/message_system.cpp +++ b/src/message_system.cpp
@@ -119,15 +119,9 @@ void MessageSystem::displayMessage(std::string_view msg, std::string speakerName
119 // textbox. 119 // textbox.
120 for (const std::string& word : words) { 120 for (const std::string& word : words) {
121 int wordWidth = 0; 121 int wordWidth = 0;
122 bool firstChar = true;
123 for (int i=0; i<word.size(); i++) { 122 for (int i=0; i<word.size(); i++) {
124 if (firstChar) {
125 firstChar = false;
126 } else {
127 wordWidth++;
128 }
129
130 wordWidth += game_.getFont().getCharacterWidth(word[i]); 123 wordWidth += game_.getFont().getCharacterWidth(word[i]);
124 wordWidth++;
131 } 125 }
132 126
133 int nextWidth = curWidth + wordWidth; 127 int nextWidth = curWidth + wordWidth;