Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
gitk: Add some more comments to the optimize_rows procedure
author
Paul Mackerras
<paulus@samba.org>
Thu, 14 Sep 2006 23:45:23 +0000
(09:45 +1000)
committer
Paul Mackerras
<paulus@samba.org>
Sat, 23 Jun 2007 10:55:30 +0000
(20:55 +1000)
Signed-off-by: Paul Mackerras <paulus@samba.org>
gitk
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
0a4dd8b
)
diff --git
a/gitk
b/gitk
index de5bae7a0e6e2603d0eaf15d9b3212934ea5fd56..a67137443b2c3cf9083c4ae5c07298032388f01c 100755
(executable)
--- a/
gitk
+++ b/
gitk
@@
-2739,7
+2739,13
@@
proc optimize_rows {row col endrow} {
set isarrow 1
}
}
set isarrow 1
}
}
+ # Looking at lines from this row to the previous row,
+ # make them go straight up if they end in an arrow on
+ # the previous row; otherwise make them go straight up
+ # or at 45 degrees.
if {$z < -1 || ($z < 0 && $isarrow)} {
if {$z < -1 || ($z < 0 && $isarrow)} {
+ # Line currently goes left too much;
+ # insert pads in the previous row, then optimize it
set npad [expr {-1 - $z + $isarrow}]
set offs [incrange $offs $col $npad]
insert_pad $y0 $x0 $npad
set npad [expr {-1 - $z + $isarrow}]
set offs [incrange $offs $col $npad]
insert_pad $y0 $x0 $npad
@@
-2750,6
+2756,8
@@
proc optimize_rows {row col endrow} {
set x0 [expr {$col + $z}]
set z0 [lindex $rowoffsets $y0 $x0]
} elseif {$z > 1 || ($z > 0 && $isarrow)} {
set x0 [expr {$col + $z}]
set z0 [lindex $rowoffsets $y0 $x0]
} elseif {$z > 1 || ($z > 0 && $isarrow)} {
+ # Line currently goes right too much;
+ # insert pads in this line and adjust the next's rowoffsets
set npad [expr {$z - 1 + $isarrow}]
set y1 [expr {$row + 1}]
set offs2 [lindex $rowoffsets $y1]
set npad [expr {$z - 1 + $isarrow}]
set y1 [expr {$row + 1}]
set offs2 [lindex $rowoffsets $y1]
@@
-2780,6
+2788,7
@@
proc optimize_rows {row col endrow} {
set z0 [expr {$xc - $x0}]
}
}
set z0 [expr {$xc - $x0}]
}
}
+ # avoid lines jigging left then immediately right
if {$z0 ne {} && $z < 0 && $z0 > 0} {
insert_pad $y0 $x0 1
set offs [incrange $offs $col 1]
if {$z0 ne {} && $z < 0 && $z0 > 0} {
insert_pad $y0 $x0 1
set offs [incrange $offs $col 1]
@@
-2788,6
+2797,7
@@
proc optimize_rows {row col endrow} {
}
if {!$haspad} {
set o {}
}
if {!$haspad} {
set o {}
+ # Find the first column that doesn't have a line going right
for {set col [llength $idlist]} {[incr col -1] >= 0} {} {
set o [lindex $offs $col]
if {$o eq {}} {
for {set col [llength $idlist]} {[incr col -1] >= 0} {} {
set o [lindex $offs $col]
if {$o eq {}} {
@@
-2806,6
+2816,8
@@
proc optimize_rows {row col endrow} {
}
if {$o eq {} || $o <= 0} break
}
}
if {$o eq {} || $o <= 0} break
}
+ # Insert a pad at that column as long as it has a line and
+ # isn't the last column, and adjust the next row' offsets
if {$o ne {} && [incr col] < [llength $idlist]} {
set y1 [expr {$row + 1}]
set offs2 [lindex $rowoffsets $y1]
if {$o ne {} && [incr col] < [llength $idlist]} {
set y1 [expr {$row + 1}]
set offs2 [lindex $rowoffsets $y1]