[commit] r2057 - trunk/GME/Gme
GMESRC Repository Notifications
gme-commit at list.isis.vanderbilt.edu
Tue Sep 18 09:52:06 CDT 2012
Author: ksmyth
Date: Tue Sep 18 09:52:06 2012
New Revision: 2057
Log:
Try again to prevent GUIObjects from overlapping or touching
Modified:
trunk/GME/Gme/ModelGrid.cpp
Modified: trunk/GME/Gme/ModelGrid.cpp
==============================================================================
--- trunk/GME/Gme/ModelGrid.cpp Tue Sep 18 09:51:57 2012 (r2056)
+++ trunk/GME/Gme/ModelGrid.cpp Tue Sep 18 09:52:06 2012 (r2057)
@@ -92,11 +92,11 @@
int endx = pt.x + size.cx;
int endy = pt.y + size.cy;
// Hack to prevent labels from overlapping
- starty -= 2;
+ //starty -= 2;
if(startx < 0 || starty < 0 || endx >= GME_MAX_GRID_DIM || endy >= GME_MAX_GRID_DIM)
return false;
- for(int i = starty; i < endy; i++)
- for(int j = startx; j < endx; j++)
+ for(int i = starty; i <= endy; i++)
+ for(int j = startx; j <= endx; j++)
if(!IsAvailable(j,i))
return false;
return true;
@@ -121,8 +121,8 @@
FindStartEnd(rect,0);
if(startx < 0 || starty < 0 || endx >= GME_MAX_GRID_DIM || endy >= GME_MAX_GRID_DIM)
return false;
- for(int y = starty; y < endy; y++)
- for(int x = startx; x < endx; x++)
+ for(int y = starty; y <= endy; y++)
+ for(int x = startx; x <= endx; x++)
if(!IsAvailable(x,y))
return false;
return true;
@@ -177,8 +177,8 @@
void CModelGrid::Set(CRect& rect, bool reset)
{
FindStartEnd(rect,1);
- for(int y = starty; y < endy; y++)
- for(int x = startx; x < endx; x++)
+ for(int y = starty; y <= endy; y++)
+ for(int x = startx; x <= endx; x++)
reset ? Reset(x,y) : Set(x,y);
}
More information about the gme-commit
mailing list