[GRASS-SVN] r30038 - grass/trunk/gui/tcltk/gis.m

svn_grass at osgeo.org svn_grass at osgeo.org
Sat Feb 9 16:39:06 EST 2008


Author: cmbarton
Date: 2008-02-09 16:39:06 -0500 (Sat, 09 Feb 2008)
New Revision: 30038

Modified:
   grass/trunk/gui/tcltk/gis.m/group.tcl
Log:
Improvement to routine to automatically use displayed maps as background for digitizing

Modified: grass/trunk/gui/tcltk/gis.m/group.tcl
===================================================================
--- grass/trunk/gui/tcltk/gis.m/group.tcl	2008-02-09 21:23:20 UTC (rev 30037)
+++ grass/trunk/gui/tcltk/gis.m/group.tcl	2008-02-09 21:39:06 UTC (rev 30038)
@@ -68,10 +68,10 @@
 proc GmGroup::display { node mod } {
     variable opt
     variable tree
-	global mon
-	global drawprog
-	global commandlist
-	set commandlist {}
+    global mon
+    global drawprog
+    global commandlist
+    set commandlist {}
 
     set tree($mon) $GmTree::tree($mon)
 	set layers ""
@@ -81,12 +81,12 @@
         if { ! ( $opt($id,_check) ) } { return }
     }
 
-	#invert layer list to put first tree node as top map layer
-	foreach n [$tree($mon) nodes $node] {
-		set layers [linsert $layers 0 $n]
-	}
-	
-	# display each node/layer
+    #invert layer list to put first tree node as top map layer
+    foreach n [$tree($mon) nodes $node] {
+	    set layers [linsert $layers 0 $n]
+    }
+    
+    # display each node/layer
     foreach n $layers {
         GmTree::display_node $n $mod
         incr drawprog
@@ -104,23 +104,29 @@
 	global mon
 	global drawprog
 	global commandlist
-	
+
 	set bg_command ""
 	
+	puts "list 1 = $commandlist"
+	
 	# display selected layers to create a display command list if needed
 	if {[llength $commandlist] == 0} {
+		puts "in loop"
 		MapCanvas::request_redraw $mon 1
 		vwait commandlist
 	}
-
+	
 	# if the layer being digitized is the only one displayed, then don't
 	# make it a background layer too. This avoids a black background.
-	if {[llength $commandlist] == 1} {return $bg_command}
+	if {[llength $commandlist] == 1 && [lindex [split [lindex $commandlist 0]] 0] == "d.vect"} {
+	    return $bg_command
+	}
 
 	# add each command in display command list to background commands
 	foreach cmd $commandlist {
 		append bg_command "$cmd;"
 	}
+	
 		
 	# get rid of the ; at the end of the background command list
 	set bg_command [string trimright $bg_command ";"]



More information about the grass-commit mailing list