summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 9f1afe0)
raw | patch | inline | side by side (parent: 9f1afe0)
author | Paul Mackerras <paulus@samba.org> | |
Mon, 27 Feb 2006 23:02:03 +0000 (10:02 +1100) | ||
committer | Paul Mackerras <paulus@samba.org> | |
Mon, 27 Feb 2006 23:02:03 +0000 (10:02 +1100) |
With the new representation of the graph lines, this turns out
much simpler now.
Signed-off-by: Paul Mackerras <paulus@samba.org>
much simpler now.
Signed-off-by: Paul Mackerras <paulus@samba.org>
gitk | patch | blob | history |
index 502f2665af64141b7fea7b40add1b880f19427fe..4e66d865f137ed9880b4e78329775937e7a25872 100755 (executable)
--- a/gitk
+++ b/gitk
}
proc clickisonarrow {id y} {
- global mainline mainlinearrow sidelines lthickness
+ global lthickness idrowranges
set thresh [expr {2 * $lthickness + 6}]
- if {[info exists mainline($id)]} {
- if {$mainlinearrow($id) ne "none"} {
- if {abs([lindex $mainline($id) 1] - $y) < $thresh} {
- return "up"
- }
- }
- }
- if {[info exists sidelines($id)]} {
- foreach ls $sidelines($id) {
- set coords [lindex $ls 0]
- set arrow [lindex $ls 2]
- if {$arrow eq "first" || $arrow eq "both"} {
- if {abs([lindex $coords 1] - $y) < $thresh} {
- return "up"
- }
- }
- if {$arrow eq "last" || $arrow eq "both"} {
- if {abs([lindex $coords end] - $y) < $thresh} {
- return "down"
- }
- }
+ set n [expr {[llength $idrowranges($id)] - 1}]
+ for {set i 1} {$i < $n} {incr i} {
+ set row [lindex $idrowranges($id) $i]
+ if {abs([yc $row] - $y) < $thresh} {
+ return $i
}
}
return {}
}
-proc arrowjump {id dirn y} {
- global mainline sidelines canv canv2 canv3
+proc arrowjump {id n y} {
+ global idrowranges canv
- set yt {}
- if {$dirn eq "down"} {
- if {[info exists mainline($id)]} {
- set y1 [lindex $mainline($id) 1]
- if {$y1 > $y} {
- set yt $y1
- }
- }
- if {[info exists sidelines($id)]} {
- foreach ls $sidelines($id) {
- set y1 [lindex $ls 0 1]
- if {$y1 > $y && ($yt eq {} || $y1 < $yt)} {
- set yt $y1
- }
- }
- }
- } else {
- if {[info exists sidelines($id)]} {
- foreach ls $sidelines($id) {
- set y1 [lindex $ls 0 end]
- if {$y1 < $y && ($yt eq {} || $y1 > $yt)} {
- set yt $y1
- }
- }
- }
- }
- if {$yt eq {}} return
+ # 1 <-> 2, 3 <-> 4, etc...
+ set n [expr {(($n - 1) ^ 1) + 1}]
+ set row [lindex $idrowranges($id) $n]
+ set yt [yc $row]
set ymax [lindex [$canv cget -scrollregion] 3]
if {$ymax eq {} || $ymax <= 0} return
set view [$canv yview]
if {$yfrac < 0} {
set yfrac 0
}
- $canv yview moveto $yfrac
- $canv2 yview moveto $yfrac
- $canv3 yview moveto $yfrac
+ allcanvs yview moveto $yfrac
}
proc lineclick {x y id isnew} {