浏览代码

make d.barscale like all the other display modules with at=: 0,0 is lower-left

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@45615 15284696-431f-4ddb-bdfa-cd5b030d7da7
Hamish Bowman 14 年之前
父节点
当前提交
6cf24f4f1f
共有 3 个文件被更改,包括 5 次插入5 次删除
  1. 1 1
      display/d.barscale/draw_scale.c
  2. 2 2
      display/d.barscale/main.c
  3. 2 2
      gui/wxpython/gui_modules/mapdisp.py

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

@@ -77,7 +77,7 @@ int draw_scale(int toptext, int size)
     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;

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

@@ -85,11 +85,11 @@ int main(int argc, char **argv)
     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";

+ 2 - 2
gui/wxpython/gui_modules/mapdisp.py

@@ -1797,7 +1797,7 @@ class MapFrame(wx.Frame):
             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 @@ class MapFrame(wx.Frame):
         ### 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.