@matheusbsbs / matheus-bagliano / commits / f340844962
Fork 0

gitk: Prevent parent link from overwriting commit headline

When I made drawlineseg responsible for drawing the link to the first child rather than drawparentlinks, that meant that the right-most X value computed by drawparentlinks didn't include those first-child links, and thus the first-child link could go over the top of the commit headline. This fixes it. Signed-off-by: Paul Mackerras <paulus@samba.org>

Paul Mackerras committed Mar 31, 2006 at 09:54 UTC f3408449622cad37ce29f23754c8e7a8fb453ff1
1 file changed +9 -9
gitk
+9 -9
@@ -1304,17 +1304,21 @@ proc drawparentlinks {id row col olds} {
1304 # rmx = right-most X coord used
1305 set rmx 0
1306 foreach p $olds {
1307 + set i [lsearch -exact $ids $p]
1308 + if {$i < 0} {
1309 + puts "oops, parent $p of $id not in list"
1310 + continue
1311 + }
1312 + set x2 [xc $row2 $i]
1313 + if {$x2 > $rmx} {
1314 + set rmx $x2
1315 + }
1316 if {[info exists idrowranges($p)] &&
1317 $row2 == [lindex $idrowranges($p) 0] &&
1318 $row2 < [lindex $idrowranges($p) 1]} {
1319 # drawlineseg will do this one for us
1320 continue
1321 }
1313 - set i [lsearch -exact $ids $p]
1314 - if {$i < 0} {
1315 - puts "oops, parent $p of $id not in list"
1316 - continue
1317 - }
1322 assigncolor $p
1323 # should handle duplicated parents here...
1324 set coords [list $x $y]
@@ -1323,10 +1327,6 @@ proc drawparentlinks {id row col olds} {
1327 } elseif {$i > $col + 1} {
1328 lappend coords [xc $row [expr {$i - 1}]] $y
1329 }
1326 - set x2 [xc $row2 $i]
1327 - if {$x2 > $rmx} {
1328 - set rmx $x2
1329 - }
1330 lappend coords $x2 $y2
1331 set t [$canv create line $coords -width [linewidth $p] \
1332 -fill $colormap($p) -tags lines.$p]