Browse Source

d.barscale/northarrow: fix layout when using frame, see https://trac.osgeo.org/grass/ticket/3121 (merge from trunk, https://trac.osgeo.org/grass/changeset/69100, https://trac.osgeo.org/grass/changeset/69107)

git-svn-id: https://svn.osgeo.org/grass/grass/branches/releasebranch_7_0@69109 15284696-431f-4ddb-bdfa-cd5b030d7da7
Anna Petrášová 8 years ago
parent
commit
ece653a510
2 changed files with 4 additions and 4 deletions
  1. 2 2
      display/d.barscale/draw_scale.c
  2. 2 2
      display/d.northarrow/draw_n_arrow.c

+ 2 - 2
display/d.barscale/draw_scale.c

@@ -87,8 +87,8 @@ int draw_scale(double east, double north, int style, int text_posn,
     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 */

+ 2 - 2
display/d.northarrow/draw_n_arrow.c

@@ -33,8 +33,8 @@ int draw_n_arrow(double east, double north, double fontsize,
     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);