rezaali / ofxUI

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

Widgets not drawing when scrolling with ofxUIScrollableCanvas #233

Closed chuckleplant closed 9 years ago

chuckleplant commented 9 years ago

Buttons and whatnot disappear when still visible using the scrollable canvas. It can be solved by changing this line in ofxUIScrollableCanvas::draw():

if((*it)->isVisible() && (*it)->getRect()->rInside(*sRect))

to

if((*it)->isVisible() && (*it)->getRect()->rIntersects(*sRect))

Maybe this is by design though. In that case, I'd suggest to make this optional.

I understand it does not make sense to draw widgets outside their canvas boundaries, I find my suggestion useful when the canvas fills the screen vertically (for vertical scrolls).

Hope it helps!

rezaali commented 9 years ago

@chuckleplant hey this was by design, I'd added a function to set the scrollable canvas to show over flowing widgets if thats what you want. Just use setShowOverflow(true) on a scrollable canvas.

https://github.com/rezaali/ofxUI/commit/5be51876ea860ec14a700ecf4f491b75ce379b4e

chuckleplant commented 9 years ago

Great thanks!