Another Text Patch

"Jack D." <[email protected]>
Newsgroups gmane.comp.lang.perl.tk
Message-ID <[email protected]>
The attached patch fixes a bug found by "thundergnat" [ I assume that is not
his real name ;) ] in the UpDownLine subroutine. The bug was stated as the
following:
 
"If you resize a Text widget (or a derivation) so that the bottom of
the window is NOT exactly at the bottom of a line of text, and then
try to move the cursor down past the bottom of the text displayed in
the window using the arrow key, the cursor advances two lines instead
of one."
 
This patch is against the original 804.027 Text.pm and does not include the
patch I sent for the AutoScan method back in November of 2004.
 
Jack
Text.diff (application/octet-stream, 472 B)
--- Text.pm	Wed Mar 17 19:33:56 2004
+++ TextNew.pm	Wed Mar 09 16:03:27 2005
@@ -1199,7 +1199,7 @@
    ($lx, $ly, $lw, $lh) = $w->dlineinfo($i);
   }
 elsif ( ($n == 1) and
-         ($ly + $lh) > ( $w->height - 2*$w->cget(-bd) - 2*$w->cget(-highlightthickness) ) )
+         ($ly + $lh) > ( $w->height - 2*$w->cget(-bd) - 2*$w->cget(-highlightthickness) - $lh + 1 ) )
   {
    #On last display line.. so scroll down and recalculate..
    $w->yview('scroll', 1, 'units');
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.