[Scummvm-git-logs] scummvm master -> dc94b96a9568dd52e5e3da3a5929158e79ecb74e
sev-
sev at scummvm.org
Mon May 10 12:08:58 UTC 2021
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
dc94b96a95 GRAPHICS: MACGUI: Fixed other cases of off-screen rendering
Commit: dc94b96a9568dd52e5e3da3a5929158e79ecb74e
https://github.com/scummvm/scummvm/commit/dc94b96a9568dd52e5e3da3a5929158e79ecb74e
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2021-05-10T14:08:30+02:00
Commit Message:
GRAPHICS: MACGUI: Fixed other cases of off-screen rendering
Changed paths:
graphics/macgui/macmenu.cpp
diff --git a/graphics/macgui/macmenu.cpp b/graphics/macgui/macmenu.cpp
index d7f9273fbf..5024a81419 100644
--- a/graphics/macgui/macmenu.cpp
+++ b/graphics/macgui/macmenu.cpp
@@ -1053,6 +1053,12 @@ bool MacMenu::mouseClick(int x, int y) {
int y1 = _items[_activeItem]->submenu->bbox.top;
uint w = _items[_activeItem]->submenu->bbox.width() + 2;
uint h = _items[_activeItem]->submenu->bbox.height() + 2;
+
+ if (x1 + w > _wm->_screenCopy->w)
+ w = _wm->_screenCopy->w - 1 - x1;
+ if (y1 + h > _wm->_screenCopy->h)
+ h = _wm->_screenCopy->h - 1 - y1;
+
g_system->copyRectToScreen(_wm->_screenCopy->getBasePtr(x1, y1), _wm->_screenCopy->pitch, x1, y1, w, h);
}
@@ -1145,6 +1151,12 @@ bool MacMenu::mouseClick(int x, int y) {
int y1 = _menustack.back()->bbox.top;
uint w = _menustack.back()->bbox.width() + 2;
uint h = _menustack.back()->bbox.height() + 2;
+
+ if (x1 + w > _wm->_screenCopy->w)
+ w = _wm->_screenCopy->w - 1 - x1;
+ if (y1 + h > _wm->_screenCopy->h)
+ h = _wm->_screenCopy->h - 1 - y1;
+
g_system->copyRectToScreen(_wm->_screenCopy->getBasePtr(x1, y1), _wm->_screenCopy->pitch, x1, y1, w, h);
}
More information about the Scummvm-git-logs
mailing list