[PD-cvs] pd/src desire.tk,1.1.2.541,1.1.2.542
chunlee
chunlee at users.sourceforge.net
Tue Oct 31 20:14:12 CET 2006
Update of /cvsroot/pure-data/pd/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18043
Modified Files:
Tag: devel_0_39
desire.tk
Log Message:
Active draw makeover
Index: desire.tk
===================================================================
RCS file: /cvsroot/pure-data/pd/src/Attic/desire.tk,v
retrieving revision 1.1.2.541
retrieving revision 1.1.2.542
diff -C2 -d -r1.1.2.541 -r1.1.2.542
*** desire.tk 31 Oct 2006 14:18:28 -0000 1.1.2.541
--- desire.tk 31 Oct 2006 19:14:09 -0000 1.1.2.542
***************
*** 3682,3685 ****
--- 3682,3689 ----
super
set @canvas $canvas
+ set @angles {45 90 -45 -90}
+ set @sides {1.6 -1.6}
+ set @length 3
+ set @length2 10
}
***************
*** 3688,3707 ****
if {$current == ""} {return}
if {![string compare $current 0]} {return}
if {[$@canvas keynav]} {
! mset {x y} [$current xy]
! set line1 [l+ [list -16 -16 0 0] [list $x $y $x $y]]
! set line2 [l+ [list -15 -15 -1 -1] [list $x $y $x $y]]
! $self item ACTIVE1 line $line1 -fill "#000000" -width 5 -arrow last -arrowshape {12 14 8}
! $self item ACTIVE2 line $line2 -fill "#ffcc00" -width 2 -arrow last -arrowshape {6 12 6}
! } else {
! if {![llength [[$@canvas widget] gettags ${self}ACTIVE1]]} {return} else {$self hide}
! }
}
def Active hide {} {
! [$@canvas widget] delete ${self}ACTIVE1 ${self}ACTIVE2
}
#-----------------------------------------------------------------------------------#
class_new Box {View}
--- 3692,3752 ----
if {$current == ""} {return}
if {![string compare $current 0]} {return}
+ set col "#ffcc00"
if {[$@canvas keynav]} {
! if {[$current class] == "Wire"} {
! $self hide_active_obj
! set i 0
! foreach side $@sides {
! mset {ax1 ay1 ax2 ay2} [$current bbox]
! set t [expr atan2($ay2-$ay1, $ax2-$ax1)]
! set cx1 [expr $ax1 + (($ax2-$ax1)* 0.15)]
! set cy1 [expr $ay1 + (($ay2-$ay1)* 0.15)]
! set cx2 [expr ($@length * cos($t+$side)) + $cx1]
! set cy2 [expr ($@length * sin($t+$side)) + $cy1]
!
! for {set n 0} {$n < 2} {incr n} {
! set angle [lindex $@angles [expr $n+$i]]
! mset {ax1 ay1 ax2 ay2} [$current bbox]
! set t [expr atan2($ay2-$ay1, $ax2-$ax1)]
! set bx1 [expr $ax1 + (($ax2-$ax1)* 0.15)]
! set by1 [expr $ay1 + (($ay2-$ay1)* 0.15)]
! set bx2 [expr ($@length2 * cos($t+$angle)) + $bx1]
! set by2 [expr ($@length2 * sin($t+$angle)) + $by1]
! set line [list $cx2 $cy2 $bx2 $by2]
! $self item LINE$angle line $line -fill $col -width 1
!
! }
! set i [expr $i+2]
! }
! } else {
! $self hide_active_wire
! mset {x y} [lmap - [$current xy] 5]
! set line1 [list $x $y $x [expr $y + $@length2]]
! set line2 [list $x $y [expr $x + $@length2] $y]
! $self item LINE1 line $line1 -fill $col -width 1
! $self item LINE2 line $line2 -fill $col -width 1
!
! }
!
! } else {
! #if {![llength [[$@canvas widget] gettags ${self}ACTIVE1]]} {return} else {$self hide}
! $self hide
! }
}
def Active hide {} {
! $self hide_active_obj
! $self hide_active_wire
}
+ def Active hide_active_wire {} {
+ foreach angle $@angles {
+ [$@canvas widget] delete ${self}LINE${angle}
+ }
+ }
+ def Active hide_active_obj {} {
+ [$@canvas widget] delete ${self}LINE1 ${self}LINE2
+ }
#-----------------------------------------------------------------------------------#
class_new Box {View}
More information about the Pd-cvs
mailing list