[GRASS-SVN] r36299 - grass/branches/develbranch_6/gui/tcltk/gis.m
svn_grass at osgeo.org
svn_grass at osgeo.org
Tue Mar 10 01:34:42 EDT 2009
Author: cmbarton
Date: 2009-03-10 01:34:41 -0400 (Tue, 10 Mar 2009)
New Revision: 36299
Modified:
grass/branches/develbranch_6/gui/tcltk/gis.m/gmtree.tcl
grass/branches/develbranch_6/gui/tcltk/gis.m/vector.tcl
Log:
Fix formatting problems in layer tree.
Modified: grass/branches/develbranch_6/gui/tcltk/gis.m/gmtree.tcl
===================================================================
--- grass/branches/develbranch_6/gui/tcltk/gis.m/gmtree.tcl 2009-03-10 04:17:27 UTC (rev 36298)
+++ grass/branches/develbranch_6/gui/tcltk/gis.m/gmtree.tcl 2009-03-10 05:34:41 UTC (rev 36299)
@@ -15,7 +15,7 @@
variable node
variable selected ""
variable dblclick
- variable legend_height 20
+ variable legend_height 25
variable legend_width 30
variable treeht 6
global array tree ;# mon
@@ -75,8 +75,8 @@
set sw [ScrolledWindow $pg($mon).sw \
-relief flat -borderwidth 0 ]
- set lw [expr {$legend_width + 27}]
- set lh [expr {$legend_height + 6}]
+ set lw [expr {$legend_width + 30}]
+ set lh [expr {$legend_height + 2}]
set tree($mon) [Tree $sw.tree_$mon \
-relief flat -borderwidth 0 -highlightthickness 0 \
Modified: grass/branches/develbranch_6/gui/tcltk/gis.m/vector.tcl
===================================================================
--- grass/branches/develbranch_6/gui/tcltk/gis.m/vector.tcl 2009-03-10 04:17:27 UTC (rev 36298)
+++ grass/branches/develbranch_6/gui/tcltk/gis.m/vector.tcl 2009-03-10 05:34:41 UTC (rev 36299)
@@ -25,18 +25,18 @@
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 0
+ set x2 [expr $lw - 6]
+ set y1 1
+ set y2 [expr $lh + 1]
+ set lwidth $opt($id,1,lwidth)
# area
if { $opt($id,1,type_area) || $opt($id,1,type_face)} {
- set x1 [expr $mar ]
- set x2 [expr {$lw - $mar} ]
- set y1 [expr $mar ]
- set y2 [expr {$lh - $mar} ]
- set lwidth $opt($id,1,lwidth)
if { $lwidth == 0 } { set lwidth 1 }
if {$opt($id,1,_use_color) == 1} {
if {$opt($id,1,_use_fcolor) == 1} {
@@ -56,11 +56,6 @@
#line
if { $opt($id,1,type_line) || $opt($id,1,type_boundary) } {
- set x1 [expr $mar ]
- set x2 [expr {$lw - $mar} ]
- set y1 [expr $mar ]
- set y2 [expr {$lh - $mar} ]
- set lwidth $opt($id,1,lwidth)
if { $lwidth == 0 } { set lwidth 1 }
if {$opt($id,1,_use_color) == 1} {
$leg create rectangle $x1 $y1 $x2 $y2 -outline $opt($id,1,color) \
@@ -69,22 +64,22 @@
}
# point
- set xc [expr {$lw / 2 + $mar - 1} ]
- set yc [expr {$lh / 2} ]
- set size $opt($id,1,size)
-
set maxpsize [expr {$lw / 3 - 2} ]
+ set size $opt($id,1,size)
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 - 2} ]
+ 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 }
- $leg create line $x1 $yc $x2 $yc -fill $opt($id,1,color) -width $lwidth
- $leg create line $xc $y1 $xc $y2 -fill $opt($id,1,color) -width $lwidth
+ set lwidth $opt($id,1,lwidth)
+ if { $lwidth == 0 } { set lwidth 1 }
+ $leg create line $px1 $yc $px2 $yc -fill $opt($id,1,color) -width $lwidth
+ $leg create line $xc $py1 $xc $py2 -fill $opt($id,1,color) -width $lwidth
}
More information about the grass-commit
mailing list