aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoseph-Eugene Winzer2017-08-24 15:23:53 +0200
committerThierry Crozat2018-01-23 01:47:01 +0000
commit2545ffd07495deccf72109d80744089e403f04d2 (patch)
tree7b8c14ed3ee1b09f412b69c110f681efef76c753
parent316aeeabd597c4e0f241673ca000bc16b90771fb (diff)
downloadscummvm-rg350-2545ffd07495deccf72109d80744089e403f04d2.tar.gz
scummvm-rg350-2545ffd07495deccf72109d80744089e403f04d2.tar.bz2
scummvm-rg350-2545ffd07495deccf72109d80744089e403f04d2.zip
SUPERNOVA: Fixes overdraw of input
-rw-r--r--engines/supernova/state.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/engines/supernova/state.cpp b/engines/supernova/state.cpp
index 3ce044e56c..7f62852911 100644
--- a/engines/supernova/state.cpp
+++ b/engines/supernova/state.cpp
@@ -980,8 +980,9 @@ void GameManager::animationOn() {
void GameManager::edit(Common::String &input, int x, int y, uint length) {
bool isEditing = true;
uint cursorIndex = input.size();
- int overdrawWidth = ((length + 1) * kFontWidth > kScreenWidth - x) ?
- kScreenWidth - x : (length + 1) * kFontWidth;
+ // NOTE: Pixels for char needed = kFontWidth + 2px left and right side bearing
+ int overdrawWidth = ((length + 1) * (kFontWidth + 2) > kScreenWidth - x) ?
+ kScreenWidth - x : (length + 1) * (kFontWidth + 2);
while (isEditing) {
_vm->_textCursorX = x;