[GRASS-SVN] r36398 - grass/branches/develbranch_6/gui/tcltk/gis.m

svn_grass at osgeo.org svn_grass at osgeo.org
Mon Mar 16 16:47:44 EDT 2009


Author: cmbarton
Date: 2009-03-16 16:47:44 -0400 (Mon, 16 Mar 2009)
New Revision: 36398

Modified:
   grass/branches/develbranch_6/gui/tcltk/gis.m/vector.tcl
Log:
Fix vector legend so that it if formatted well on Linux and Mac.

Modified: grass/branches/develbranch_6/gui/tcltk/gis.m/vector.tcl
===================================================================
--- grass/branches/develbranch_6/gui/tcltk/gis.m/vector.tcl	2009-03-16 20:37:27 UTC (rev 36397)
+++ grass/branches/develbranch_6/gui/tcltk/gis.m/vector.tcl	2009-03-16 20:47:44 UTC (rev 36398)
@@ -25,10 +25,15 @@
    
     set lh $GmTree::legend_height
     set lw $GmTree::legend_width
-    set mar 2
+    set mar 0
     set leg $opt($id,1,_legend)
 
     $leg delete all
+    set x1 4
+    set x2 [expr $lw - 7]
+    set y1 4
+    set y2 [expr $lh - 2]
+    set lwidth  $opt($id,1,lwidth)
 
     # area    
     if { $opt($id,1,type_area) || $opt($id,1,type_face)} {
@@ -69,17 +74,17 @@
     }
 
     # point 
-    set xc [expr {$lw / 2 + $mar - 1} ]
-    set yc [expr {$lh / 2} ]
+    set maxpsize  [expr {$lw / 3 - 2} ]
     set size $opt($id,1,size)
-   
-    set maxpsize  [expr {$lw / 3 - 2} ]
     if { $size > $maxpsize } { set size $maxpsize }
-	set x1 [expr {$xc - $size / 2} ]
-	set x2 [expr {$xc + $size / 2 + 1} ]
-	set y1 [expr {$yc - $size / 2 }]
-	set y2 [expr {$yc + $size / 2 + 1} ]
 
+    set xc [expr {$lw / 2 - 1} ]
+    set yc [expr {$lh / 2 + 2} ]
+    set px1 [expr {$xc - $size / 2} ]
+    set px2 [expr {$xc + $size / 2 } ]
+    set py1 [expr {$yc - $size / 2 }]
+    set py2 [expr {$yc + $size / 2 } ]
+
     if { $opt($id,1,type_point) || $opt($id,1,type_centroid) } {
 	set lwidth  $opt($id,1,lwidth)
 	if { $lwidth == 0 } { set lwidth 1 }
@@ -259,7 +264,7 @@
 		set tbl [lindex $vdblist 1]
 		set db [lindex $vdblist 3]
 		set drv [lindex $vdblist 4]
-		set cmd "db.select table=$tbl database=$db driver=$drv"
+		set cmd "db.select table=$tbl database=$db driver=dbf"
 		run_panel $cmd
 	}
 }



More information about the grass-commit mailing list