mirror of
https://github.com/moparisthebest/minetest
synced 2024-11-14 21:35:05 -05:00
Limit drawing rect of selected item to viewport size (fixes #4341)
This commit is contained in:
parent
0f0502109e
commit
bdf8f85493
@ -2362,6 +2362,7 @@ void GUIFormSpecMenu::drawSelectedItem()
|
|||||||
|
|
||||||
core::rect<s32> imgrect(0,0,imgsize.X,imgsize.Y);
|
core::rect<s32> imgrect(0,0,imgsize.X,imgsize.Y);
|
||||||
core::rect<s32> rect = imgrect + (m_pointer - imgrect.getCenter());
|
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);
|
drawItemStack(driver, m_font, stack, rect, NULL, m_gamedef, IT_ROT_DRAGGED);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user