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

@@ -225,11 +225,10 @@ namespace OpenRA.Mods.Common.Widgets
// ChildOrigin enumerates the widget tree, so only evaluate it once
var co = ChildOrigin;
drawBounds.X -= co.X;
drawBounds.Y -= co.Y;
drawBounds = new Rectangle(drawBounds.X - co.X, drawBounds.Y - co.Y, drawBounds.Width, drawBounds.Height);
foreach (var child in Children)
if (child.Bounds.IntersectsWith(drawBounds))
if (child.Bounds.ToRectangle().IntersectsWith(drawBounds))
child.DrawOuter();
Game.Renderer.DisableScissor();