[GRASS-SVN] r31400 - grass/trunk/general/g.region

svn_grass at osgeo.org svn_grass at osgeo.org
Sat May 17 16:03:24 EDT 2008


Author: neteler
Date: 2008-05-17 16:03:24 -0400 (Sat, 17 May 2008)
New Revision: 31400

Modified:
   grass/trunk/general/g.region/main.c
Log:
Ivan Shmakov: set (top, bottom) from the 3d vector specified by vect= (trac #121)

Modified: grass/trunk/general/g.region/main.c
===================================================================
--- grass/trunk/general/g.region/main.c	2008-05-17 20:03:10 UTC (rev 31399)
+++ grass/trunk/general/g.region/main.c	2008-05-17 20:03:24 UTC (rev 31400)
@@ -532,6 +532,8 @@
 			map_window.south = box.S;
 			map_window.west	 = box.W;
 			map_window.east	 = box.E;
+			map_window.top   = box.T;
+			map_window.bottom = box.B;
 
 			if (!first)
 			{
@@ -548,6 +550,10 @@
 					window.east : map_window.east;
 				window.west = (window.west < map_window.west) ?
 					window.west : map_window.west;
+				if (map_window.top > window.top)
+					window.top = map_window.top;
+				if (map_window.bottom < window.bottom)
+					window.bottom = map_window.bottom;
 			}
 
 			if(window.north == window.south)
@@ -560,6 +566,12 @@
 			      window.west = window.west - 0.5 * temp_window.ew_res;
 			      window.east = window.east + 0.5 * temp_window.ew_res;
 			}
+			if (window.top == window.bottom) {
+			      window.bottom = (window.bottom
+					       - 0.5 * temp_window.tb_res);
+			      window.top    = (window.top
+					       + 0.5 * temp_window.tb_res);
+			}
 
 			if(flag.res_set->answer)
 			    G_align_window (&window, &temp_window);



More information about the grass-commit mailing list