Modifying Source To Allow For Negative Anchor Values

I want to modify the source so that there can be anchor values x<0% and x>100% (essentially, outside of the bounds of a particular canvas). I want to do this because I have certain images that I want to take up a particular proportion of the screen (i.e. an image that takes up 10% of the screen will take up the same 10% of the screen regardless of resolution), and “Scale To Device” doesn’t give the particular effect I want. I have found the following values in dev/Gems/LyShine/Code/Source/UiTransform2dComponent.cpp (around line 1134-1135):

->Attribute(AZ::Edit::Attributes::Min, 0.0f)
->Attribute(AZ::Edit::Attributes::Max, 100.0f)

I have modified these values, and am able to enter in negative values for the anchors, but these values snap to 0% or 100% whenever I try to modify the values in the editor. I looked at the SetAnchor code (lines ~785-880), but it doesn’t look like the value is actually getting modified there.

  • How would I go about doing this?
  • Are there any other classes/modules/systems that assume that the anchor values are between 0% and 100%?