diff --git a/OpenRA.Mods.Common/EditorBrushes/EditorActorBrush.cs b/OpenRA.Mods.Common/EditorBrushes/EditorActorBrush.cs index d578b181e9..b109602978 100644 --- a/OpenRA.Mods.Common/EditorBrushes/EditorActorBrush.cs +++ b/OpenRA.Mods.Common/EditorBrushes/EditorActorBrush.cs @@ -72,7 +72,7 @@ namespace OpenRA.Mods.Common.Widgets public bool HandleMouseInput(MouseInput mi) { - // Exclusively uses left and right mouse buttons, but nothing else + // Exclusively uses left and right mouse buttons, but nothing else. if (mi.Button != MouseButton.Left && mi.Button != MouseButton.Right) return false; @@ -155,7 +155,7 @@ namespace OpenRA.Mods.Common.Widgets { this.editorLayer = editorLayer; - // Take an immutable copy of the reference + // Take an immutable copy of the reference. this.actor = actor.Clone(); } diff --git a/OpenRA.Mods.Common/EditorBrushes/EditorMarkerLayerBrush.cs b/OpenRA.Mods.Common/EditorBrushes/EditorMarkerLayerBrush.cs index b84ceca419..e3b2e5e9bc 100644 --- a/OpenRA.Mods.Common/EditorBrushes/EditorMarkerLayerBrush.cs +++ b/OpenRA.Mods.Common/EditorBrushes/EditorMarkerLayerBrush.cs @@ -123,6 +123,7 @@ namespace OpenRA.Mods.Common.Widgets public void Execute() { + paintTiles.TrimExcess(); } public void Do() diff --git a/OpenRA.Mods.Common/EditorBrushes/EditorResourceBrush.cs b/OpenRA.Mods.Common/EditorBrushes/EditorResourceBrush.cs index 4a5c4b4b01..bff88f0256 100644 --- a/OpenRA.Mods.Common/EditorBrushes/EditorResourceBrush.cs +++ b/OpenRA.Mods.Common/EditorBrushes/EditorResourceBrush.cs @@ -130,6 +130,7 @@ namespace OpenRA.Mods.Common.Widgets public void Execute() { + cellResources.TrimExcess(); } public void Do() diff --git a/OpenRA.Mods.Common/EditorBrushes/EditorTileBrush.cs b/OpenRA.Mods.Common/EditorBrushes/EditorTileBrush.cs index d30bfc319b..66e22a32af 100644 --- a/OpenRA.Mods.Common/EditorBrushes/EditorTileBrush.cs +++ b/OpenRA.Mods.Common/EditorBrushes/EditorTileBrush.cs @@ -11,7 +11,6 @@ using System.Collections.Generic; using System.IO; -using System.Linq; using OpenRA.Graphics; using OpenRA.Mods.Common.Terrain; using OpenRA.Mods.Common.Traits; @@ -49,7 +48,7 @@ namespace OpenRA.Mods.Common.Widgets terrainRenderer = world.WorldActor.Trait(); Template = id; - TerrainTemplate = terrainInfo.Templates.First(t => t.Value.Id == id).Value; + TerrainTemplate = terrainInfo.Templates[Template]; cell = wr.Viewport.ViewToWorld(wr.Viewport.WorldToViewPx(Viewport.LastMousePos)); UpdatePreview(); }