UIStroke renders visible frame on mobile when parent Frame AbsoluteSize is (0,0)

When using UIStroke on a Frame with size set to UDim2.new(0,0,0,0), the UIStroke is still rendered on mobile devices, even though the parent frame has no visible size.

Steps to reproduce

  1. Create a frame in ScreenGui
  2. Set the frame’s properties
Size = UDim2.new(0,0,0,0)
Visible = true
  1. Insert UIStroke as a child of the frame
  2. Set the UIStroke properties:
StrokeSizingMode = Enum.StrokeSizingMode.ScaledSize
Thickness = 0.017
ApplyStrokeMode = Enum.ApplyStrokeMode.Contextual
BorderStrokePosition = Enum.BorderStrokePosition.Inner
  1. Play the game in mobile or enable Device Emulator (phone) in studio

Observed Behavior

  • A white frame rendered with unknown size
  • Checking the frame AbsoluteSize still returns (0, 0)
  • This does not occur on desktop

Current Fix

use StrokeSizingMode FixedSize

System Information

  • CPU 12th Gen Intel(R) Core™ i5-12400F
  • Memory 16GB
  • GPU GeForce RTX 4060

Expected behavior

If a frame absolute size is (0, 0), its UIStroke should:

  • not render at all, or
  • fully respect the parent zero size and remain invisible

A private message is associated with this bug report

1 Like