[GRASS-SVN] r45615 - in grass/trunk: display/d.barscale gui/wxpython/gui_modules

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Mar 9 07:30:13 EST 2011


Author: hamish
Date: 2011-03-09 04:30:13 -0800 (Wed, 09 Mar 2011)
New Revision: 45615

Modified:
   grass/trunk/display/d.barscale/draw_scale.c
   grass/trunk/display/d.barscale/main.c
   grass/trunk/gui/wxpython/gui_modules/mapdisp.py
Log:
make d.barscale like all the other display modules with at=: 0,0 is lower-left

Modified: grass/trunk/display/d.barscale/draw_scale.c
===================================================================
--- grass/trunk/display/d.barscale/draw_scale.c	2011-03-09 07:19:27 UTC (rev 45614)
+++ grass/trunk/display/d.barscale/draw_scale.c	2011-03-09 12:30:13 UTC (rev 45615)
@@ -77,7 +77,7 @@
     D_get_src(&t, &b, &l, &r);
 
     x_pos = (int)(east * (r - l) / 100.);
-    y_pos = (int)(north * (b - t) / 100.);
+    y_pos = (int)((100. - north) * (b - t) / 100.);
 
     if (draw == 1) {
 	int w, h;

Modified: grass/trunk/display/d.barscale/main.c
===================================================================
--- grass/trunk/display/d.barscale/main.c	2011-03-09 07:19:27 UTC (rev 45614)
+++ grass/trunk/display/d.barscale/main.c	2011-03-09 12:30:13 UTC (rev 45615)
@@ -85,11 +85,11 @@
     opt3->key = "at";
     opt3->key_desc = "x,y";
     opt3->type = TYPE_DOUBLE;
-    opt3->answer = "0.0,0.0";
+    opt3->answer = "0.0,5.0";
     opt3->options = "0-100";
     opt3->required = NO;
     opt3->description =
-	_("The screen coordinates for top-left corner of label ([0,0] is top-left of frame)");
+	_("The screen coordinates for top-left corner of label ([0,0] is lower-left of frame)");
 
     fsize = G_define_option();
     fsize->key = "fontsize";

Modified: grass/trunk/gui/wxpython/gui_modules/mapdisp.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/mapdisp.py	2011-03-09 07:19:27 UTC (rev 45614)
+++ grass/trunk/gui/wxpython/gui_modules/mapdisp.py	2011-03-09 12:30:13 UTC (rev 45615)
@@ -1797,7 +1797,7 @@
             gdialogs.DecorationDialog(parent = self, title = _('Scale and North arrow'),
                                       size = (350, 200),
                                       style = wx.DEFAULT_DIALOG_STYLE | wx.CENTRE,
-                                      cmd = ['d.barscale', 'at=0,5'],
+                                      cmd = ['d.barscale', 'at=0,95'],
                                       ovlId = id,
                                       name = 'barscale',
                                       checktxt = _("Show/hide scale and North arrow"),
@@ -1807,7 +1807,7 @@
         ### dialog cannot be show as modal - in the result d.barscale is not selectable
         ### self.dialogs['barscale'].ShowModal()
         self.dialogs['barscale'].Show()
-        self.MapWindow.mouse['use'] = 'pointer'        
+        self.MapWindow.mouse['use'] = 'pointer'
 
     def OnAddLegend(self, event):
         """!Handler for legend map decoration menu selection.



More information about the grass-commit mailing list