UI Scaling Bug with GuiBase2d Dragging and Resizing
Summary
When drag-moving or resizing any GuiBase2d
(e.g., Frame
, ImageLabel
, TextLabel
) under a parent with a UIScale
, its Offset values are incorrectly multiplied by the scale factor. The Studio’s drag handles show the correct target values, but the object jumps by (Offset × (Scale − 1))
on mouse-drag. Adding UIPadding further multiplies the starting Offset by the padding value, worsening the issue.
Steps to Reproduce
Setup
- Insert a
ScreenGui
inStarterGui
. - Create a
Frame
named Container inside theScreenGui
. - Add a
UIScale
to Container and set itsScale
to 1.5. - Inside Container, insert a child
Frame
(or anyGuiBase2d
) named ** долгиInner**. - In the Properties panel, set Inner’s
Position
to{ X.Scale = 0.2; X.Offset = 100 }, { Y.Scale = 0.2; Y.Offset = 100 }
.
Drag to Move
- In the viewport, drag the Inner frame by its edges or body.
-
Observe:
- Instead of starting at
Offset = 100
, it jumps toOffset = 100 + (100 × (1.5 − 1)) = 150
and then moves. - The drag-handles on the frame outline show the correct
Offset = 100
, but the object’s pixel position is offset by 50 pixels.
- Instead of starting at
Resize
- Drag a corner handle to resize Inner.
-
Observe:
- The same multiplication error occurs on the
Offset
component ofSize
.
- The same multiplication error occurs on the
Add Padding
- Add a
UIPadding
to Container. -
Observe:
- The child’s starting
Offset
is multiplied by the padding values when dragging or resizing begins.
- The child’s starting
Actual Behavior
-
Position.Offset jumps by
(Offset × (Scale − 1))
at drag-start. - Size.Offset exhibits the same issue.
- UIPadding values further multiply the jump.
- Studio’s drag-handles display the un-jumped values, causing inconsistent UI feedback.
Visual Evidence
Positioning
-
Before Dragging (1.5 Scale):
-
After Dragging (1.5 Scale):
Resizing
-
Before Resizing (1.5 Scale):
-
After Resizing (1.5 Scale):
Video Demonstration
System Specs
- Roblox Version: January 24, 2025
- OS: macOS 15.5 Beta (issue persists across previous releases)
Thank you for reviewing this bug report! Please let me know if further details or testing are needed.