From 55c5664cedcf978560ea3277a99a92a181be8021 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Thu, 3 Oct 2019 15:20:21 +0200 Subject: GRPAHICS: MACGUI: Avoid overdraw --- graphics/macgui/macmenu.cpp | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'graphics/macgui') diff --git a/graphics/macgui/macmenu.cpp b/graphics/macgui/macmenu.cpp index 61fa02b7b9..9d05c76fc3 100644 --- a/graphics/macgui/macmenu.cpp +++ b/graphics/macgui/macmenu.cpp @@ -836,15 +836,13 @@ bool MacMenu::mouseClick(int x, int y) { return false; if (_menustack.size() > 0 && _menustack.back()->bbox.contains(x, y)) { - MacMenuSubMenu *it = _menustack.back(); - int numSubItem = MIN((y - it->bbox.top) / kMenuDropdownItemHeight, it->subitems.size() - 1); + MacMenuSubMenu *menu = _menustack.back(); + int numSubItem = MIN((y - menu->bbox.top) / kMenuDropdownItemHeight, menu->subitems.size() - 1); if (numSubItem != _activeSubItem) { _activeSubItem = numSubItem; + menu->highlight = _activeSubItem; - it->highlight = _activeSubItem; - - renderSubmenu(it); _contentIsDirty = true; } @@ -873,11 +871,8 @@ bool MacMenu::mouseClick(int x, int y) { MacMenuSubMenu *menu = _menustack.back(); _activeSubItem = MIN((y - menu->bbox.top) / kMenuDropdownItemHeight, menu->subitems.size() - 1); - menu->highlight = _activeSubItem; - renderSubmenu(menu); - _contentIsDirty = true; return true; @@ -888,7 +883,6 @@ bool MacMenu::mouseClick(int x, int y) { _activeSubItem = -1; if (_menustack.size()) { - renderSubmenu(_menustack.back()); _contentIsDirty = true; } -- cgit v1.2.3