Here is the demo:
How can I get the proper boundingBox measure? I’m confused.
Here is the demo:
How can I get the proper boundingBox measure? I’m confused.
I know that the transformedMeasure stores the bounding box of the control after applying all transformations. But when I print it’s value, it’s quite different from its _currentMeasure even there is no rotation or scailing. Is that normal?
Theorically it’s the right size, but consider it’s the measure of the rectangle, not the actual rounded button. So unless you have an angle of 0°, 90°, 180°, 270°, you will always have a little offset :
Even if you see this :
There is actually no gap if you consider the rectangle :
Yeah, you are right! But may be the rootContainer of the AdvancedTexture should not be involved in the calculation of transformMatrix when the engine adaptToDeviceRatio is true and the AdvancedTexture adaptiveScaling is true. You will find the rootContainer scaling is changed and the bounding box will be wrong.
The measure is right.
You can try it in your local. The adaptToDeviceRatio of the playground engine is false.
I am using MacOS, my devicePixelRatio is 1.67777