about summary refs log tree commit diff
diff options
context:
space:
mode:
authoroy <tom_adams@web.de>2012-01-12 13:59:04 -0800
committeroy <tom_adams@web.de>2012-01-12 13:59:04 -0800
commit1a1b4a096a08c58fed357ee0c6afbc0e5218f7a8 (patch)
treea48e75779ed5f4c5eedd76f0a7f1fb48f135a93d
parent4cce03c6e632c24d6e23377e8d071fb7d84eceac (diff)
parentf737910e0a32466e0009734c31e2f1b921f64851 (diff)
downloadzcatch-1a1b4a096a08c58fed357ee0c6afbc0e5218f7a8.tar.gz
zcatch-1a1b4a096a08c58fed357ee0c6afbc0e5218f7a8.zip
Merge pull request #918 from SushiTee/FillSelection_fix
fixed FillSelection so it actually fills the current selection
-rw-r--r--src/game/editor/layer_tiles.cpp6
1 files 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<CLayerTiles*>(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;