Replace Rectangle widget bounds with a new WidgetBounds struct.

This commit is contained in:
Paul Chote
2023-10-31 17:06:34 +00:00
committed by Pavel Penev
parent 31c37662cf
commit 03b413a892
7 changed files with 47 additions and 29 deletions

View File

@@ -9,7 +9,6 @@
*/
#endregion
using OpenRA.Primitives;
using OpenRA.Widgets;
namespace OpenRA.Mods.Common.Widgets
@@ -50,11 +49,11 @@ namespace OpenRA.Mods.Common.Widgets
break;
case MouseInputEvent.Down:
moving = true;
Bounds = new Rectangle(Bounds.X + vec.X, Bounds.Y + vec.Y, Bounds.Width, Bounds.Height);
Bounds = new WidgetBounds(Bounds.X + vec.X, Bounds.Y + vec.Y, Bounds.Width, Bounds.Height);
break;
case MouseInputEvent.Move:
if (moving)
Bounds = new Rectangle(Bounds.X + vec.X, Bounds.Y + vec.Y, Bounds.Width, Bounds.Height);
Bounds = new WidgetBounds(Bounds.X + vec.X, Bounds.Y + vec.Y, Bounds.Width, Bounds.Height);
break;
}