UIStroke Thickness Bug on Mobile Devices with Notches

I have encountered a UI rendering bug that exclusively occurs on mobile devices with a notch (e.g., iPhone 14 Pro, iPhone X). The issue arises when a UIStroke is applied to a Frame with an extremely high thickness value in proportion to the Gui Object’s size, causing the frame’s rendered size to distort despite its AbsoluteSize remaining unchanged. This issue may be caused by the additional screen space reserved for the notch, which the UI cannot utilize properly.

How to Reproduce Bug:

  1. Download Place file:
    UiStrokeBugPlace.rbxl (57.6 KB)
  2. Navigate to Test, click on Device
  3. From the device dropdown menu, choose a notched mobile device (e.g., iPhone 14 Pro, iPhone X).
  4. In Studio’s Explorer, navigate to StarterGui → ScreenGui → Frame → UIStroke.
  5. Increase the Thickness property to 350 or higher.
  6. Observe how the Frame visually distorts, even though AbsoluteSize remains correct.

Findings:

  • The bug only occurs on mobile devices with a notch.
  • On devices without a notch, even extreme values (1000+) do not cause distortion.
  • In this place file, highlighting the Frame will show you that the Frame is still a 33x33 px size, but this is simply untrue once the thickness is increased to at least 350.

Impact:

  • This issue disrupts UI elements in my game’s tutorial system, where UIStroke is used to highlight important UI buttons by darkening surrounding areas. The unexpected distortion makes the highlighting inaccurate and inconsistent.

Expected Behavior:

  • The Frame’s visual size should remain consistent regardless of the UIStroke.Thickness value.
  • Increasing UIStroke.Thickness should only affect the stroke width and should not alter the Frame’s dimensions or shape.
  • The Frame should maintain its expected AbsoluteSize, ensuring accurate UI highlighting, even on mobile devices with notches.
  • The behavior should be consistent across all devices, regardless of whether they have a notch or not.

Would appreciate a fix or guidance on workarounds for this issue. Let me know if additional details are needed. Thanks!

A private message is associated with this bug report

1 Like