From 4cbe0a6fe650045351eeb2f2e62310e0ee6e52cb Mon Sep 17 00:00:00 2001 From: Thanasis Antoniou Date: Mon, 6 May 2019 21:24:51 +0300 Subject: BLADERUNNER: Fix disabled mouse hover image blinking issues --- engines/bladerunner/ui/ui_image_picker.cpp | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) (limited to 'engines/bladerunner/ui') diff --git a/engines/bladerunner/ui/ui_image_picker.cpp b/engines/bladerunner/ui/ui_image_picker.cpp index 2a6d870512..dfc897eafa 100644 --- a/engines/bladerunner/ui/ui_image_picker.cpp +++ b/engines/bladerunner/ui/ui_image_picker.cpp @@ -197,19 +197,16 @@ void UIImagePicker::draw(Graphics::Surface &surface) { continue; } - if (i == _hoveredImageIndex && i == _pressedImageIndex && _isButtonDown) { - if (!_vm->_mouse->isDisabled()) { - if (img.shapeDown) { - img.shapeDown->draw(surface, img.rect.left, img.rect.top); - } - } - } else if (i == _hoveredImageIndex && !_isButtonDown) { - if (!_vm->_mouse->isDisabled()) { - if (img.shapeHovered) { - img.shapeHovered->draw(surface, img.rect.left, img.rect.top); - } - } + if (i == _hoveredImageIndex && i == _pressedImageIndex && _isButtonDown + && !_vm->_mouse->isDisabled() + && img.shapeDown) { + img.shapeDown->draw(surface, img.rect.left, img.rect.top); + } else if (i == _hoveredImageIndex && !_isButtonDown + && !_vm->_mouse->isDisabled() + && img.shapeHovered) { + img.shapeHovered->draw(surface, img.rect.left, img.rect.top); } else { + // this shape should always be the fall back shape to prevent blinking if (img.shapeUp) { img.shapeUp->draw(surface, img.rect.left, img.rect.top); } -- cgit v1.2.3