From b8a932a084d4947f35534f8b1b60cab06da3e2b2 Mon Sep 17 00:00:00 2001 From: Chris Forbes Date: Sun, 1 Jul 2012 18:31:46 +1200 Subject: [PATCH] try to make selection feel better --- OpenRA.Editor/Surface.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/OpenRA.Editor/Surface.cs b/OpenRA.Editor/Surface.cs index 65079e5041..441a5c72dc 100755 --- a/OpenRA.Editor/Surface.cs +++ b/OpenRA.Editor/Surface.cs @@ -203,7 +203,7 @@ namespace OpenRA.Editor else if (IsPaste) PasteSelection(); else - SelectionEnd = GetBrushLocation(); + SelectionEnd = GetBrushLocationBR(); } protected override void OnMouseDown(MouseEventArgs e) @@ -294,6 +294,14 @@ namespace OpenRA.Editor return new CPos(vX / TileSet.TileSize, vY / TileSet.TileSize); } + public CPos GetBrushLocationBR() + { + var vX = (int)Math.Floor((MousePos.X - Offset.X) / Zoom); + var vY = (int)Math.Floor((MousePos.Y - Offset.Y) / Zoom); + return new CPos((vX + TileSet.TileSize - 1) / TileSet.TileSize, + (vY + TileSet.TileSize - 1) / TileSet.TileSize); + } + public void DrawActor(SGraphics g, CPos p, ActorTemplate t, ColorPalette cp) { var centered = t.Appearance == null || !t.Appearance.RelativeToTopLeft;