[GRASS-SVN] r70840 - grass/trunk/display/d.text

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Apr 5 16:39:56 PDT 2017


Author: hcho
Date: 2017-04-05 16:39:56 -0700 (Wed, 05 Apr 2017)
New Revision: 70840

Modified:
   grass/trunk/display/d.text/main.c
Log:
d.text: Fix -p, -g (See #3320)

Modified: grass/trunk/display/d.text/main.c
===================================================================
--- grass/trunk/display/d.text/main.c	2017-04-05 22:46:50 UTC (rev 70839)
+++ grass/trunk/display/d.text/main.c	2017-04-05 23:39:56 UTC (rev 70840)
@@ -307,10 +307,10 @@
     if (opt.charset->answer)
 	D_encoding(opt.charset->answer);
 
-    D_setup_unity(0);
+    D_setup(0);
 
     /* figure out where to put text */
-    D_get_src(&win.t, &win.b, &win.l, &win.r);
+    D_get_dst(&win.t, &win.b, &win.l, &win.r);
 
     if (flag.s->answer)
 	size = atof(opt.size->answer);
@@ -631,6 +631,10 @@
 	D_text_rotation(0.0);
 
     D_get_text_box(text, &t, &b, &l, &r);
+    t = D_u_to_d_row(t);
+    b = D_u_to_d_row(b);
+    l = D_u_to_d_col(l);
+    r = D_u_to_d_col(r);
 
     if (rotation != 0.0)
 	D_text_rotation(rotation * 180.0 / M_PI);
@@ -688,13 +692,13 @@
  	D_use_color(fg_color); /* restore */
     }
 
-    D_pos_abs(*x, *y);
+    D_pos_abs(D_d_to_u_col(*x), D_d_to_u_row(*y));
     D_text(text);
 
     if (bold) {
-	D_pos_abs(*x, *y + 1);
+	D_pos_abs(D_d_to_u_col(*x), D_d_to_u_row(*y + 1));
 	D_text(text);
-	D_pos_abs(*x + 1, *y);
+	D_pos_abs(D_d_to_u_col(*x + 1), D_d_to_u_row(*y));
 	D_text(text);
     }
 



More information about the grass-commit mailing list