Use MousePositionScaled instead of absolute MousePosition to fix UI-scaling issues (#2568)

* Use MousePositionScaled instead of absolute MousePosition to fix UI-scaling issues

* Fix compiler warnings
This commit is contained in:
R. Neuser
2020-12-04 08:24:22 -06:00
committed by GitHub
parent 0ed1191623
commit c4c4a1ca8c
2 changed files with 3 additions and 4 deletions

View File

@@ -182,7 +182,7 @@ namespace Content.Client.GameObjects.EntitySystems
_userInterfaceManager.ModalRoot.AddChild(_currentEntityList);
var size = _currentEntityList.List.CombinedMinimumSize;
var box = UIBox2.FromDimensions(args.ScreenCoordinates.Position, size);
var box = UIBox2.FromDimensions(_userInterfaceManager.MousePositionScaled, size);
_currentEntityList.Open(box);
return true;
@@ -190,7 +190,7 @@ namespace Content.Client.GameObjects.EntitySystems
private void OnContextButtonPressed(IEntity entity)
{
OpenContextMenu(entity, new ScreenCoordinates(_inputManager.MouseScreenPosition));
OpenContextMenu(entity, new ScreenCoordinates(_userInterfaceManager.MousePositionScaled));
}
private void FillEntityPopup(VerbSystemMessages.VerbsResponseMessage msg)