Limit drawing rect of selected item to viewport size (fixes #4341)
authorsfan5 <sfan5@live.de>
Tue, 20 Dec 2016 13:27:14 +0000 (14:27 +0100)
committersfan5 <sfan5@live.de>
Tue, 20 Dec 2016 13:29:12 +0000 (14:29 +0100)
src/guiFormSpecMenu.cpp

index 981a8edbaa1a219ae3f96f0b7b3b9567c902a67e..bfc7a9b79c1a85a9e4af1f2f07f817c0001b18ef 100644 (file)
@@ -2362,6 +2362,7 @@ void GUIFormSpecMenu::drawSelectedItem()
 
        core::rect<s32> imgrect(0,0,imgsize.X,imgsize.Y);
        core::rect<s32> rect = imgrect + (m_pointer - imgrect.getCenter());
+       rect.constrainTo(driver->getViewPort());
        drawItemStack(driver, m_font, stack, rect, NULL, m_gamedef, IT_ROT_DRAGGED);
 }