UICorner modifiers added to a GuiObject with a size that is negative on any axis will not show any change, instead of rounding the corners like normal. I use negative GuiObject sizes consistently, and this is causing issues in my game.
Repro Steps
Add a ScreenGui with a Frame inside into StarterGui
Add a UICorner into the Frame
Give the Frame a size that is negative on at least one axis.
The Frame should now remain completely square regardless of UICorner settings.
I’m assuming this has been happening since the release of UICorners. I imagine the cause of this is due to how the radius of the corners is limited to half the size of the GuiObject - this calculation probably doesn’t use the absolute value, and thus interprets its maximum radius as being less than 0 in the case of a negatively sized object.
If there is some situation that’s not solvable without negative size you should make a feature request, it doesn’t change the fact that negative size isn’t supported and thus you will sometimes run into broken behavior like this if you use it.
AnchorPoint even goes a long way towards making situations where negative size may have been useful in the past intuitive to solve in a supported way.
Documentation doesn’t say anything about this, so bug report is on-point:
It should either be fixed or documentation should be written mentioning this. Studio lets you get into this case so it is definitely undesirable behavior.
Studio only “lets you get into this case” insofar as UDim2s inherently let you specify sizes where it’s unclear whether it’s possible for a negative size to manifest when the object is eventually used in context. The visual UI editor does not let you create Guis with negative sizes.
It will be. The documentation mentioned above should not be endorsing negative sizes.
You shouldn’t ever need negative sizes. Anchor point with positive Size and positive or negative Position values should get whatever you need.
If you’re finding yourself needing to use negative sizes, then post in #help-and-feedback with your specific issue and someone will be able to advise on the correct properties with a positive Size to achieve the same effect.