diff --git a/OpenRA.Game/Renderer.cs b/OpenRA.Game/Renderer.cs index 04980b8112..331f8d47b9 100644 --- a/OpenRA.Game/Renderer.cs +++ b/OpenRA.Game/Renderer.cs @@ -214,7 +214,7 @@ namespace OpenRA { // Must remain inside the current scissor rect if (scissorState.Any()) - rect.Intersect(scissorState.Peek()); + rect = Rectangle.Intersect(rect, scissorState.Peek()); Flush(); Context.EnableScissor(rect.Left, rect.Top, rect.Width, rect.Height); diff --git a/OpenRA.Mods.Common/Widgets/Logic/ConnectionLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/ConnectionLogic.cs index 7eaebd62ec..dc28f601a1 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/ConnectionLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/ConnectionLogic.cs @@ -11,6 +11,7 @@ using System; using OpenRA.Network; +using OpenRA.Primitives; using OpenRA.Widgets; namespace OpenRA.Mods.Common.Widgets.Logic @@ -212,10 +213,10 @@ namespace OpenRA.Mods.Common.Widgets.Logic { // Hide the logo and center just the text if (title != null) - title.Bounds.Offset(logo.Bounds.Left - title.Bounds.Left, 0); + title.Bounds.X = logo.Bounds.Left; if (version != null) - version.Bounds.Offset(logo.Bounds.Left - version.Bounds.Left, 0); + version.Bounds.X = logo.Bounds.X; width -= logo.Bounds.Width; } @@ -228,7 +229,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic var container = panel.GetOrNull("MOD_CONTAINER"); if (container != null) { - container.Bounds.Offset((container.Bounds.Width - width) / 2, 0); + container.Bounds.X += (container.Bounds.Width - width) / 2; container.Bounds.Width = width; } } diff --git a/OpenRA.Mods.Common/Widgets/ScrollPanelWidget.cs b/OpenRA.Mods.Common/Widgets/ScrollPanelWidget.cs index 2ede4855a7..d4033f0e50 100644 --- a/OpenRA.Mods.Common/Widgets/ScrollPanelWidget.cs +++ b/OpenRA.Mods.Common/Widgets/ScrollPanelWidget.cs @@ -178,7 +178,11 @@ namespace OpenRA.Mods.Common.Widgets var drawBounds = backgroundRect.InflateBy(-BorderWidth, -BorderWidth, -BorderWidth, -BorderWidth); Game.Renderer.EnableScissor(drawBounds); - drawBounds.Offset(-ChildOrigin); + // ChildOrigin enumerates the widget tree, so only evaluate it once + var co = ChildOrigin; + drawBounds.X -= co.X; + drawBounds.Y -= co.Y; + foreach (var child in Children) if (child.Bounds.IntersectsWith(drawBounds)) child.DrawOuter();