From f737910e0a32466e0009734c31e2f1b921f64851 Mon Sep 17 00:00:00 2001 From: SushiTee Date: Thu, 12 Jan 2012 22:03:55 +0100 Subject: fixed FillSelection so it actually fills the current selection --- src/game/editor/layer_tiles.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/game/editor/layer_tiles.cpp b/src/game/editor/layer_tiles.cpp index 7532c1bd..9a21e5ce 100644 --- a/src/game/editor/layer_tiles.cpp +++ b/src/game/editor/layer_tiles.cpp @@ -159,6 +159,8 @@ void CLayerTiles::FillSelection(bool Empty, CLayer *pBrush, CUIRect Rect) if(m_Readonly) return; + Snap(&Rect); + int sx = ConvertX(Rect.x); int sy = ConvertY(Rect.y); int w = ConvertX(Rect.w); @@ -166,9 +168,9 @@ void CLayerTiles::FillSelection(bool Empty, CLayer *pBrush, CUIRect Rect) CLayerTiles *pLt = static_cast(pBrush); - for(int y = 0; y <= h; y++) + for(int y = 0; y < h; y++) { - for(int x = 0; x <= w; x++) + for(int x = 0; x < w; x++) { int fx = x+sx; int fy = y+sy; -- cgit 1.4.1