[GRASS-SVN] r65178 - grass/trunk/display/d.mon

svn_grass at osgeo.org svn_grass at osgeo.org
Sun May 3 03:07:43 PDT 2015


Author: martinl
Date: 2015-05-03 03:07:43 -0700 (Sun, 03 May 2015)
New Revision: 65178

Modified:
   grass/trunk/display/d.mon/main.c
   grass/trunk/display/d.mon/start.c
Log:
d.mon: fix to respect GRASS_RENDER_HEIGHT and GRASS_RENDER_WIDTH


Modified: grass/trunk/display/d.mon/main.c
===================================================================
--- grass/trunk/display/d.mon/main.c	2015-05-03 09:52:52 UTC (rev 65177)
+++ grass/trunk/display/d.mon/main.c	2015-05-03 10:07:43 UTC (rev 65178)
@@ -204,8 +204,8 @@
     if (start_opt->answer) {
         int width, height;
 
-        width = width_opt->answer ? atoi(width_opt->answer) : 640;
-        height = height_opt->answer ? atoi(height_opt->answer) : 480;
+        width = width_opt->answer ? atoi(width_opt->answer) : 0;
+        height = height_opt->answer ? atoi(height_opt->answer) : 0;
         if (res_opt->answer) {
             int res;
             

Modified: grass/trunk/display/d.mon/start.c
===================================================================
--- grass/trunk/display/d.mon/start.c	2015-05-03 09:52:52 UTC (rev 65177)
+++ grass/trunk/display/d.mon/start.c	2015-05-03 10:07:43 UTC (rev 65178)
@@ -214,12 +214,14 @@
     write(fd, buf, strlen(buf));
     sprintf(buf, "GRASS_RENDER_FILE_READ=TRUE\n");
     write(fd, buf, strlen(buf));
-    if (width) {
-	sprintf(buf, "GRASS_RENDER_WIDTH=%d\n", width);
+    if (width > 0 || getenv("GRASS_RENDER_WIDTH")) {
+	sprintf(buf, "GRASS_RENDER_WIDTH=%d\n",
+                width > 0 ? width : atoi(getenv("GRASS_RENDER_WIDTH")));
 	write(fd, buf, strlen(buf));
     }
-    if (height) {
-	sprintf(buf, "GRASS_RENDER_HEIGHT=%d\n", height);
+    if (height > 0 || getenv("GRASS_RENDER_HEIGHT")) {
+	sprintf(buf, "GRASS_RENDER_HEIGHT=%d\n",
+                height > 0? height : atoi(getenv("GRASS_RENDER_HEIGHT")));
 	write(fd, buf, strlen(buf));
     }
     if (bgcolor) {



More information about the grass-commit mailing list