From b35ef40895989d7d64e0f2dd7d0a055082b59569 Mon Sep 17 00:00:00 2001 From: Borja Lorente Date: Sat, 9 Jul 2016 13:09:11 +0200 Subject: MACVENTURE: Fix temporal window reallocation --- engines/macventure/macventure.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'engines/macventure') diff --git a/engines/macventure/macventure.cpp b/engines/macventure/macventure.cpp index bd3374e894..9994df2c73 100644 --- a/engines/macventure/macventure.cpp +++ b/engines/macventure/macventure.cpp @@ -856,10 +856,14 @@ ObjID MacVentureEngine::getParent(ObjID objID) { } Common::Rect MacVentureEngine::getObjBounds(ObjID objID) { - BorderBounds bounds = _gui->borderBounds(_gui->getWindowData(findParentWindow(objID)).type); // HACK Common::Point pos = getObjPosition(objID); - pos.x += bounds.leftOffset; - pos.y += bounds.topOffset; + + WindowReference win = findParentWindow(objID); + if (win != kNoWindow) { // If it's not in a window YET, we don't really care about the border + BorderBounds bounds = _gui->borderBounds(_gui->getWindowData(win).type); // HACK + pos.x += bounds.leftOffset; + pos.y += bounds.topOffset; + } uint w = _gui->getObjWidth(objID); // This shouldn't go here uint h = _gui->getObjHeight(objID); return Common::Rect(pos.x, pos.y, pos.x + w, pos.y + h); -- cgit v1.2.3