1
0
Fork 0
mirror of https://github.com/Ellpeck/MLEM.git synced 2024-11-22 12:58:33 +01:00

undo the width/height "fix"

This commit is contained in:
Ellpeck 2020-03-18 03:38:30 +01:00
parent cd70b22ae5
commit 739d337d49

View file

@ -231,22 +231,21 @@ namespace MLEM.Ui {
RectangleF searchArea = default; RectangleF searchArea = default;
if (this.SelectedElement?.Root != null) { if (this.SelectedElement?.Root != null) {
searchArea = this.SelectedElement.Area; searchArea = this.SelectedElement.Area;
var view = this.System.Viewport; var (_, _, width, height) = this.System.Viewport;
view.Inflate(view.Width, view.Height);
switch (dir) { switch (dir) {
case Direction2.Down: case Direction2.Down:
searchArea.Height += view.Height; searchArea.Height += height;
break; break;
case Direction2.Left: case Direction2.Left:
searchArea.X -= view.Width; searchArea.X -= width;
searchArea.Width += view.Width; searchArea.Width += width;
break; break;
case Direction2.Right: case Direction2.Right:
searchArea.Width += view.Width; searchArea.Width += width;
break; break;
case Direction2.Up: case Direction2.Up:
searchArea.Y -= view.Height; searchArea.Y -= height;
searchArea.Height += view.Height; searchArea.Height += height;
break; break;
} }
} }