V3.8 - Mask Component - Orientation Switch

In my project I have Used Mask( type - GRAPHICS_RECT) to show a portion of a node. It work well and all child in the node are affected by the mask.

This work well until i change the design resolution of the view :- view.setDesignResolutionSize() + view.setOrientation()

After changing the orientation the mask doesn’t intend to work as expected. When applied all child are not visible. I checked the position of the child they are at right location, but anyhow they get lost. And if i remove the mask they come back.

Is it related to relative position? I debug but I am not able to narrow it down. Also if i switch back to resolution every thing work fine.

The resolution switch only impact the node which have mask associated to it all other nodes in scene work as expected.

Any pointers for directions.
Thanks in advance

  1. pls check if it is affected by widget component.
  2. you can set the mask node position by using the node position that you want to show. In short, you can get the correct position through the functions convertToWorldSpaceAR, convertToNodeSpaceAR,
  3. Here is two links for two functions:
    convertToWorldSpaceAR: Cocos Creator API
    convertToNodeSpaceAR : Cocos Creator API
    Note: Also you can search the functions on the website: https://forum.cocosengine.org/, may it will help you more.

@Tom_k
Thanks for the reference.
Its strange why engine is not able to map world to node space when orientation switch happen automatically. Though every thing is intact just the mask component is leading to issue.

A quick hack i did is post orientation change i just pick the current position of node and set it again.

this.node.setPosition(this.node.getPosition());

it fix the issue.

I strongly believe something in the mask component need to be revisited. Will circle back when i get time. Currently busy with the ongoing release.
Thanks for the function reference.