From: Paul M. <pa...@sa...> - 2006-02-08 03:59:52
|
dr...@hw... writes: > Paul Mackerras <pa...@sa...> wrote: > > > > Is it possible that line segments that are more than 32768 (or 65536) > > pixels high could cause a problem? > > > > There is code in place that is suppose to handle this. > (Specifically the TkCanvTranslatePath() routine in tkCanvUtil.c.) > And as far as anybody knows, it works. But we are suggesting > that perhaps you have found a bug. To fix it, though, we really > need to catch it in the act of failing.... I finally got around to capturing and reducing an example where it fails. If you run the script below, it will create a window showing a canvas that should have just a single line running from top to bottom. However, in addition to the real line, it also displays a straight vertical line starting at the top of the canvas. I tried varying the last y coordinate. On a Linux/ppc64 machine with tk8.5a2, it fails for 29419.5 but not for anything less (even 29419.499999). On a Linux/x86 machine with tk8.4, the threshold was 29648.5. Interesting that it isn't 32768... Also, I just checked that it fails with current CVS. Paul. #!/bin/sh # -*- tcl -*- \ exec wish "$0" -- "$@" scrollbar .s -command ".c yview" -highlightthickness 0 pack .s -side right -fill y canvas .c -width 200 -height 350 -bg white -bd 0 \ -yscrollincr 15 -yscrollcommand ".s set" pack .c -side top -fill both -expand 1 bind .c <ButtonRelease-4> ".c yview scroll -5 units" bind .c <ButtonRelease-5> ".c yview scroll 5 units" bind . q {destroy .} .c create line {25.5 280.5 40.5 295.5 55.5 310.5 55.5 325.5 70.5 340.5 70.5 1780.5 85.5 1795.5 85.5 1825.5 100.5 1840.5 115.5 1855.5 115.5 2050.5 130.5 2065.5 130.5 2425.5 115.5 2440.5 115.5 2635.5 100.5 2650.5 100.5 29980} -width 2 -fill red .c conf -scrollregion {0 0 0 30000} |