rezaali / ofxUI

[DEPRECATED] UI Addon for openFrameworks
http://www.syedrezaali.com/#/ofxui-project-showcase/
518 stars 202 forks source link

ofxUIButton Release function hit variable must be updated at proper moment #247

Closed ghost closed 9 years ago

ghost commented 9 years ago

in ofxUIButton::mouseReleased() hit variable is updated at end of function. it normally does not make problem. but when calling some functions that blocks, it has some bug. I called ofSystemLoadDialog(..., folder=true)

and it blocks while user select a folder, and when mouse moves to outside of the button, it's hit variable is still true, therefore mouseReleased() function is called again,

ghost commented 9 years ago

like ofxUIButton::mousePressed() hit = false; should positioned here.

if(rect->inside(x, y) || (label->isVisible() && label->getPaddingRect()->inside(x, y)))
{
    hit = false;
rezaali commented 9 years ago

updated here https://github.com/rezaali/ofxUI/commit/122dfe4735fa0908ac42ffcf9fdfec867871b462, thanks!