-
Notifications
You must be signed in to change notification settings - Fork 570
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clip the invalidation example. #929
Conversation
Totally forgot that issue 😝 One of druids goals is to abstract platform wonkiness away where possible and having clipping on some platforms but not on others actually adds custom druid wokiness. IMO anything that is not explicitly platform specific should behave exactly the same on all platforms we support. Thus we should either have clipping on all platforms (seems preferable) or on none. |
It should be easy enough to enable clipping on all platforms. I think the other one isn't possible, though. For example, the windows docs explicitly say that on the paint callback you aren't allowed to paint outside the invalidated rect, so I think we have to do clipping there. |
Gotta Clip 'em All seems like the best choice then 👍 |
Cool, I've opened #941 |
yea this is... tricky, and feels like policy. We haven't really codified what we should do when a widget draws outside of its bounds; my hunch is that we should clip by default, but allow for opting in to overflow? |
I don't think there's a way to opt-in to overflow with GTK for what it's worth. |
Due to what @jneem said I think clipping always is the best choice:
|
this is explicitly about the partial invalidation case? clipping makes more sense there, I agree. |
Yeah it's about partial invalidation. Widgets can still overpaint as much as they want inside the window's invalidation rect union. |
So if one wants a widget to draw outside of its bounds, it can just invalidated that area as well. |
Ignoring partial invalidation and just talking about widgets painting outside their bounds: isn't this what |
I think there's a performance impact for doing so much clipping, but I haven't measured it. |
Fixes #872.
This makes the invalidation example act the same on all platforms, and it also explains what's going on in a comment.