Skip to content

Commit

Permalink
Fixing guidebook not resizable from left and right (#5618)
Browse files Browse the repository at this point in the history
* Fixing guidebook not resizable from left and right

issue 34504 in space-wizards/space-station-14 needs this fix

* update fix guideBood not resizable

a safer and more error resistent solution to space-wizards/space-station-14#34504

* Mask DragMode.Move

---------

Co-authored-by: ElectroJr <[email protected]>
  • Loading branch information
PROG-MohamedDwidar and ElectroJr authored Feb 8, 2025
1 parent c4a5752 commit d2aa8ec
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 13 deletions.
2 changes: 1 addition & 1 deletion RELEASE-NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ END TEMPLATE-->

### Bugfixes

*None yet*
* Fixed `BaseWindow` sometimes not properly updating the mouse cursor shape.

### Other

Expand Down
14 changes: 2 additions & 12 deletions Robust.Client/UserInterface/CustomControls/BaseWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@ protected internal override void MouseMove(GUIMouseMoveEventArgs args)
{
var cursor = CursorShape.Arrow;
var previewDragMode = GetDragModeFor(args.RelativePosition);
previewDragMode &= ~DragMode.Move;

switch (previewDragMode)
{
case DragMode.Top:
Expand All @@ -117,9 +119,6 @@ protected internal override void MouseMove(GUIMouseMoveEventArgs args)

case DragMode.Bottom | DragMode.Left:
case DragMode.Top | DragMode.Right:
cursor = CursorShape.Crosshair;
break;

case DragMode.Bottom | DragMode.Right:
case DragMode.Top | DragMode.Left:
cursor = CursorShape.Crosshair;
Expand Down Expand Up @@ -161,15 +160,6 @@ protected internal override void MouseMove(GUIMouseMoveEventArgs args)
var rect = new UIBox2(left, top, right, bottom);
LayoutContainer.SetPosition(this, rect.TopLeft);
SetSize = rect.Size;

/*
var timing = IoCManager.Resolve<IGameTiming>();
var l = GetValue<float>(LayoutContainer.MarginLeftProperty);
var t = GetValue<float>(LayoutContainer.MarginTopProperty);
Logger.Debug($"{timing.CurFrame}: {rect.TopLeft}/({l}, {t}), {rect.Size}/{SetSize}");
*/
}
}

Expand Down

0 comments on commit d2aa8ec

Please sign in to comment.