We are trying to show a dotted line on screen (simple image) and clip it using a container visual element set with overflow: hidden.
This line has to rotate. We rotate the container by setting its .transform.rotation, and the image appears correctly rotated.
However, while the image is correctly rotated, the container clips the image using its un-rotated rectangle form.
Correct behaviour:
Incorrect behaviour (notice the line is cut at the start and end)
The clipping is currently not aware of the transform.rotation. We have a full overhaul of the rotation that will add more features that will begin soon.
For the moment, is there any specific reason you are using the overflow:hidden flag? I think that by disabling that you will have the wanted result.
We are aiming to have an API to do primitives, and also to implement the rotation with the clipping in the near future. Both would be more elegant solution to what you are doing.
In the meantime, you could use the meshAPI to generate your own lines or even include some IMGUI container to draw them dynamically, but both would probably be harder to implement than just adjusting the size of the container based on the angle as you proposed.
Clipping might be a bit overkill for this use case. Consider using an Image and setting its size and uv/sourceRect properties to use a part of your line texture: