ofxMSAInteractiveObject icon indicating copy to clipboard operation
ofxMSAInteractiveObject copied to clipboard

ofScale breaks coordinates

Open Raiuc opened this issue 7 years ago • 1 comments

Hi. I'm working with the addon to use buttons inside a little application. When I use ofScale(0.5, 0.5) the app draws the buttons correctly inside the scaled layout, however I can't get the isMousePressed event in the new coordinates.

For example if I draw a button in the layout unscaled at (500,500) and then I do ofScale(0.5, 0.5), the new button will be drawn at (250,250) however the button will not catch clicks on that point but on the original unscaled position (500,500). How can I fix this? Thank you.

Raiuc avatar Jul 13 '18 01:07 Raiuc

Hi, unfortunately the events in MSAInteractiveObject don't check for any transformations. The way to solve this would be to transform the coordinates of the rect before checking against mouse coordinates, however when I wrote this addon many years ago there wasn't a way of getting the current transformation. I know now there is a ofGetCurrentMatrix function, but I'm not sure if it works as desired. Sorry I can't be more helpful. There are many other widget based gui addons now for OF that might be more useful too?

memoakten avatar Jul 14 '18 02:07 memoakten