Closed timoisalive closed 8 years ago
Yes, that's one feature that was lost with the change of making clipRect
just an internal optimization of the mask
feature. Sorry!
So you have to do this manually. The best approach depends on your actual problem, of course. Perhaps there's a simpler solution in your case, but one way to do it is to recursively search for a masked display object and use the getBounds
method on the mask to find out its bounds in another coordinate system. You can then use the RectangleUtil
to intersect the actual object bounds with the mask bounds. (The mask must be part of the display tree (have a parent
) for this to work.)
I know that this is more difficult then before, but the old behavior had to be changed in that respect. Let me know if you need any more help!
Ok, no worries, and thanks for the workaround tip! :)
You're welcome, and thanks for your understanding! :smile:
Previously when using clipRect, the display object's size would update according to the clipRect. Instead of clipRect one should use a mask inStarling 2.0, but unfortunately the display object size is not affected by the mask. Is this on purpose or is this a bug...?
If it's on purpose, how should I get the "masked size" of an object, if the mask is nested somewhere deep in the display object's children...?