setPaintingIsUnclipped question

Does “setPaintingIsUnclipped” on a component only affect that one component, are all its children too? I have the situation that I have a large component, that includes sixteen children, each containing dozens of components and some children as well.

I currently set “setPaintingIsUnclipped” on each and every component within the hierarchy, but I wonder if calling it on the parent component alone would suffice.

It only affects the one you call it on. When each child is painted, they’ll do their own clipping unless you disable it.

1 Like

Thanks for the clarification.

Using setPaintingIsUnclipped on a component that has children is not working well.
See that thread:

I think that thread was just a misunderstanding of what they expected it to do.

As long as none of the components draw outside their own bounds (and as long as all the children are safely within the bounds of their parent) then it will work perfectly well on hierarchies of components too.

I don’t think it’s working perfectly.
my point in the other thread was that if a component is setPaintingIsUnclipped(), then it will always be entirely repainted whenever its child is repainted, even if it’s unnecessary.

Oh, well yes, that’s true.

that seems undesirable. do you think you will change this behavior?

No… not sure it’d be possible to fix that without defeating the purpose of the optimisation itself.

1 Like

OK, so the takeaway here is: only apply that flag to the children not having children themselves for optimal performance.

I guess you are right, and therefore I suspect that adding a couple of assertions for that may be convenient:

  • one in setPaintingIsUnclipped(), which triggers if the Component it is called onto, already has children

  • another one in the methods that add children to a Component, that triggers if the unclipped flag is set at the moment of the addition

2 Likes