Skip to content

keep popup elements on screen

What does this PR do? This PR introduces changes which make sure MkTooltip and MkUserPopup won't appear too far to the left, but instead stay within the bounds of the screen.

The change is introduced by making sure the x position of the popup or tooltip is never less than 1px from the left side of the screen. The 1 px is to allow for a teeny bit of margin and the reasoning behind the value is that the clamping from the right side was already done by keeping the popup at least 1px from the edge of the screen. But i'm open to other suggestions when it comes to the margin value.

Screenshots:

Before:

Phone:

simulator_screenshot_AE190625-819E-4B26-ADA2-DF929E0CB802 simulator_screenshot_646F91EB-1425-474A-AD50-14F4059F6107

Desktop:

image

(The MkUserPopup is just the right size to not float off the screen when in desktop mode so it's hard to demonstrate)

After:

Phone:

simulator_screenshot_C04C68EA-9E23-43EC-B4CA-982BDB282085simulator_screenshot_EE0C3DB2-5570-4D11-818E-1BCAF7A0CF5B

Desktop:

image

(as for the MkUserPopup, again, there were no issues with it sliding off screen on desktop)

Contribution Guidelines By submitting this merge request, you agr!ee to follow our Contribution Guidelines

  • I agree to follow this project's Contribution Guidelines
  • I have made sure to test this pull request

Merge request reports

Loading