From: sfan5 Date: Tue, 20 Dec 2016 13:27:14 +0000 (+0100) Subject: Limit drawing rect of selected item to viewport size (fixes #4341) X-Git-Tag: 0.4.15~15 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=bdf8f8549331270dc828289762c1de26d7e5e96e;p=oweals%2Fminetest.git Limit drawing rect of selected item to viewport size (fixes #4341) --- diff --git a/src/guiFormSpecMenu.cpp b/src/guiFormSpecMenu.cpp index 981a8edba..bfc7a9b79 100644 --- a/src/guiFormSpecMenu.cpp +++ b/src/guiFormSpecMenu.cpp @@ -2362,6 +2362,7 @@ void GUIFormSpecMenu::drawSelectedItem() core::rect imgrect(0,0,imgsize.X,imgsize.Y); core::rect rect = imgrect + (m_pointer - imgrect.getCenter()); + rect.constrainTo(driver->getViewPort()); drawItemStack(driver, m_font, stack, rect, NULL, m_gamedef, IT_ROT_DRAGGED); }