high UIStroke thickness causes UIAspectRatioConstraint to be incorrect on some mobile devices

If you have a ui element with a UIAspectRatioConstraint and a UIStroke, if the UIStroke thickness is too high it seems to render at double the aspect ratio on some mobile device emulations.

repro:
set device emulation to one of these mobile devices (does not seem to happen on other ones):
IPhone X/XR
Samsung Galaxy A51
Xiaomi Redmi Note 9
IPhone 14 Pro

add a screengui and a frame
add a UIAspectRatioConstraint and UIStroke to the frame
set UIStroke thickness to a large value like 1000

I have also tested joining a game with this on my phone and it had the same issue.

repro file
uistrokebug.rbxl (68.1 KB)

Bumping this issue with further details.

  1. It doesn’t matter if there’s any UI constraints. Only thing which matters if UI stroke fully goes outside of screen.
  2. If condition above has been meet. Object which has UIStroke will get additional size equal to device safe areas size:
  3. You can downscale UIStroke thickness, but:

    This’s the max pixel offset you can use. Giving even 1 more will produce a bug.

This issue ruins how devices with safe insets show UIStrokes, which I utilize a lot.

Hi @GamEditoPro could you elaborate more on your use-case? Are you using stroke thickness like a background frame?

I used it for tutorial - when I want to highlight specific object, I make frame around it - it’s transparent, bright area. All other is darkened out, to make contrast.
Second use-case I had - transition frame. Circle one - you teleport from pos a to pos b - during that process screen fades in black and then fades back. Same for tutorial transitions.
(I know that I have some bugs in tutorial, like images not loaded, grass being green, but that’s not the point)

1 Like

Thanks @GamEditoPro this helps a lot!

For this use case, do you mind configuring the inset behavior of screengui as None? Or do you explicitly rely on the auto extension behavior of the notch area?

I don’t want any GUI to use fullscreen without notch spaces. And I can’t do this transition fully in separate UIs, because I need it to be not ontop of everything, for example - narraitor text is above it, but all other UI of tutorial - nope.