aboutsummaryrefslogtreecommitdiff
path: root/engines/hugo/mouse.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/hugo/mouse.cpp')
-rw-r--r--engines/hugo/mouse.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/engines/hugo/mouse.cpp b/engines/hugo/mouse.cpp
index 558a596b35..3674c90757 100644
--- a/engines/hugo/mouse.cpp
+++ b/engines/hugo/mouse.cpp
@@ -121,12 +121,24 @@ void MouseHandler::cursorText(const char *buffer, const int16 cx, const int16 cy
int16 sx, sy;
if (cx < kXPix / 2) {
sx = cx + kCursorNameOffX;
- sy = (_vm->_inventory->getInventoryObjId() == -1) ? cy + kCursorNameOffY : cy + kCursorNameOffY - (_vm->_screen->fontHeight() + 1);
+ if (_vm->_inventory->getInventoryObjId() == -1) {
+ sy = cy + kCursorNameOffY;
+ } else {
+ sy = cy + kCursorNameOffY - (_vm->_screen->fontHeight() + 1);
+ if (sy < 0) {
+ sx = cx + kCursorNameOffX + 25;
+ sy = cy + kCursorNameOffY;
+ }
+ }
} else {
sx = cx - sdx - kCursorNameOffX / 2;
sy = cy + kCursorNameOffY;
}
+ if (sy < 0) {
+ sy = 0;
+ }
+
// Display the string and add rect to display list
_vm->_screen->shadowStr(sx, sy, buffer, _TBRIGHTWHITE);
_vm->_screen->displayList(kDisplayAdd, sx, sy, sdx, sdy);