Переглянути джерело

d.mon: fix to respect GRASS_RENDER_HEIGHT and GRASS_RENDER_WIDTH

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@65178 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 10 роки тому
батько
коміт
7aba1315c6
2 змінених файлів з 8 додано та 6 видалено
  1. 2 2
      display/d.mon/main.c
  2. 6 4
      display/d.mon/start.c

+ 2 - 2
display/d.mon/main.c

@@ -204,8 +204,8 @@ int main(int argc, char *argv[])
     if (start_opt->answer) {
     if (start_opt->answer) {
         int width, height;
         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) {
         if (res_opt->answer) {
             int res;
             int res;
             
             

+ 6 - 4
display/d.mon/start.c

@@ -214,12 +214,14 @@ int start_mon(const char *name, const char *output, int select,
     write(fd, buf, strlen(buf));
     write(fd, buf, strlen(buf));
     sprintf(buf, "GRASS_RENDER_FILE_READ=TRUE\n");
     sprintf(buf, "GRASS_RENDER_FILE_READ=TRUE\n");
     write(fd, buf, strlen(buf));
     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));
 	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));
 	write(fd, buf, strlen(buf));
     }
     }
     if (bgcolor) {
     if (bgcolor) {