From 739d337d493af280d6df2afd5d51bfe83a4d9b2b Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Wed, 18 Mar 2020 03:38:30 +0100 Subject: [PATCH] undo the width/height "fix" --- MLEM.Ui/UiControls.cs | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/MLEM.Ui/UiControls.cs b/MLEM.Ui/UiControls.cs index 4d4a714..f2af41e 100644 --- a/MLEM.Ui/UiControls.cs +++ b/MLEM.Ui/UiControls.cs @@ -231,22 +231,21 @@ namespace MLEM.Ui { RectangleF searchArea = default; if (this.SelectedElement?.Root != null) { searchArea = this.SelectedElement.Area; - var view = this.System.Viewport; - view.Inflate(view.Width, view.Height); + var (_, _, width, height) = this.System.Viewport; switch (dir) { case Direction2.Down: - searchArea.Height += view.Height; + searchArea.Height += height; break; case Direction2.Left: - searchArea.X -= view.Width; - searchArea.Width += view.Width; + searchArea.X -= width; + searchArea.Width += width; break; case Direction2.Right: - searchArea.Width += view.Width; + searchArea.Width += width; break; case Direction2.Up: - searchArea.Y -= view.Height; - searchArea.Height += view.Height; + searchArea.Y -= height; + searchArea.Height += height; break; } }