[GRASS-SVN] r57719 - grass/trunk/display/d.northarrow
svn_grass at osgeo.org
svn_grass at osgeo.org
Mon Sep 16 23:07:04 PDT 2013
Author: hamish
Date: 2013-09-16 23:07:03 -0700 (Mon, 16 Sep 2013)
New Revision: 57719
Modified:
grass/trunk/display/d.northarrow/draw_n_arrow.c
grass/trunk/display/d.northarrow/main.c
Log:
add support for basic and fancy compass
Modified: grass/trunk/display/d.northarrow/draw_n_arrow.c
===================================================================
--- grass/trunk/display/d.northarrow/draw_n_arrow.c 2013-09-17 05:45:42 UTC (rev 57718)
+++ grass/trunk/display/d.northarrow/draw_n_arrow.c 2013-09-17 06:07:03 UTC (rev 57719)
@@ -59,8 +59,14 @@
D_text("N");
break;
case '9':
+ case 'f':
D_pos_abs(x_pos - (tr + tl) / 2, y_pos - 55);
D_text("N");
+ break;
+ case 'b':
+ D_pos_abs(x_pos - (tr + tl) / 2, y_pos - 48.5);
+ D_text("N");
+ break;
case '2':
case '5':
case '6':
@@ -119,6 +125,12 @@
case '9':
symbol_size = 17.;
break;
+ case 'b':
+ symbol_size = 80.;
+ break;
+ case 'f':
+ symbol_size = 100.;
+ break;
default:
G_fatal_error(_("Could not parse symbol"));
}
@@ -126,8 +138,15 @@
x0 = D_d_to_u_col(x_pos);
y0 = D_d_to_u_row(y_pos);
- strcpy(icon, "n_arrows/n_arrow");
- strncat(icon, n_arrow_num, 32);
+ if (n_arrow_num[0] == 'b')
+ strcpy(icon, "n_arrows/compass");
+ else if (n_arrow_num[0] == 'f')
+ strcpy(icon, "n_arrows/fancy_compass");
+ else {
+ strcpy(icon, "n_arrows/n_arrow");
+ strncat(icon, n_arrow_num, 32);
+ }
+
Symb = S_read(icon);
if(!Symb)
Modified: grass/trunk/display/d.northarrow/main.c
===================================================================
--- grass/trunk/display/d.northarrow/main.c 2013-09-17 05:45:42 UTC (rev 57718)
+++ grass/trunk/display/d.northarrow/main.c 2013-09-17 06:07:03 UTC (rev 57719)
@@ -44,8 +44,8 @@
n_arrow = G_define_option();
n_arrow->key = "style";
- n_arrow->description = _("North arrow style (used only with the -n flag)");
- n_arrow->options = "1a,1b,2,3,4,5,6,7a,7b,8a,8b,9";
+ n_arrow->description = _("North arrow style");
+ n_arrow->options = "1a,1b,2,3,4,5,6,7a,7b,8a,8b,9,fancy_compass,basic_compass";
n_arrow->answer = "1a";
n_arrow->guisection = _("Style");
@@ -73,7 +73,7 @@
fsize->key = "fontsize";
fsize->type = TYPE_DOUBLE;
fsize->required = NO;
- fsize->answer = "12";
+ fsize->answer = "14";
fsize->options = "1-360";
fsize->description = _("Font size");
More information about the grass-commit
mailing list