[GRASS-SVN] r69108 - in grass/branches/releasebranch_7_2/display: d.barscale d.northarrow

svn_grass at osgeo.org svn_grass at osgeo.org
Mon Aug 8 20:10:59 PDT 2016


Author: annakrat
Date: 2016-08-08 20:10:59 -0700 (Mon, 08 Aug 2016)
New Revision: 69108

Modified:
   grass/branches/releasebranch_7_2/display/d.barscale/draw_scale.c
   grass/branches/releasebranch_7_2/display/d.northarrow/draw_n_arrow.c
Log:
d.barscale/northarrow: fix layout when using frame, see #3121 (merge from trunk, r69100, r69107)

Modified: grass/branches/releasebranch_7_2/display/d.barscale/draw_scale.c
===================================================================
--- grass/branches/releasebranch_7_2/display/d.barscale/draw_scale.c	2016-08-09 03:07:50 UTC (rev 69107)
+++ grass/branches/releasebranch_7_2/display/d.barscale/draw_scale.c	2016-08-09 03:10:59 UTC (rev 69108)
@@ -91,8 +91,8 @@
     D_setup_unity(0);
     D_get_src(&t, &b, &l, &r);
 
-    x_pos = east * (r - l) / 100.;
-    y_pos = (100. - north) * (b - t) / 100.;
+    x_pos = l + (int)(east * (r - l) / 100.);
+    y_pos = t + (int)((100. - north) * (b - t) / 100.);
 
 
     D_setup(0);                 /* back to regular coordinate settings */

Modified: grass/branches/releasebranch_7_2/display/d.northarrow/draw_n_arrow.c
===================================================================
--- grass/branches/releasebranch_7_2/display/d.northarrow/draw_n_arrow.c	2016-08-09 03:07:50 UTC (rev 69107)
+++ grass/branches/releasebranch_7_2/display/d.northarrow/draw_n_arrow.c	2016-08-09 03:10:59 UTC (rev 69108)
@@ -35,8 +35,8 @@
     D_setup_unity(0);
     D_get_src(&t, &b, &l, &r);
 
-    x_pos = east * (r - l) / 100.;
-    y_pos = (100. - north) * (b - t) / 100.;
+    x_pos = l + (int)(east * (r - l) / 100.);
+    y_pos = t + (int)((100. - north) * (b - t) / 100.);
 
     if (line_width > 0)
         D_line_width(line_width);



More information about the grass-commit mailing list