[GRASS-SVN] r33069 - in grass/trunk: include lib/display
svn_grass at osgeo.org
svn_grass at osgeo.org
Mon Aug 25 13:55:23 EDT 2008
Author: glynn
Date: 2008-08-25 13:55:22 -0400 (Mon, 25 Aug 2008)
New Revision: 33069
Modified:
grass/trunk/include/display.h
grass/trunk/lib/display/draw2.c
Log:
Add D_get_text_box
Modified: grass/trunk/include/display.h
===================================================================
--- grass/trunk/include/display.h 2008-08-25 16:45:03 UTC (rev 33068)
+++ grass/trunk/include/display.h 2008-08-25 17:55:22 UTC (rev 33069)
@@ -75,6 +75,7 @@
void D_clip_to_map(void);
void D_line_width(double);
+void D_get_text_box(const char *, double *, double *, double *, double *);
int D_cont_abs_cull(double, double);
int D_cont_rel_cull(double, double);
Modified: grass/trunk/lib/display/draw2.c
===================================================================
--- grass/trunk/lib/display/draw2.c 2008-08-25 16:45:03 UTC (rev 33068)
+++ grass/trunk/lib/display/draw2.c 2008-08-25 17:55:22 UTC (rev 33069)
@@ -324,6 +324,18 @@
R_line_width(d > 0 ? d : 0);
}
+void D_get_text_box(const char *text, double *t, double *b, double *l, double *r)
+{
+ double T, B, L, R;
+
+ R_get_text_box(text, &T, &B, &L, &R);
+
+ *t = D_d_to_u_row(T);
+ *b = D_d_to_u_row(B);
+ *l = D_d_to_u_col(L);
+ *r = D_d_to_u_col(R);
+}
+
static int line_clip(double x1, double y1, double x2, double y2)
{
struct vector a, b;
More information about the grass-commit
mailing list