From 90c0b929ea9c55d9561e04a5e3b1751e771386f3 Mon Sep 17 00:00:00 2001 From: ferrieux Date: Mon, 20 Jul 2009 23:29:05 +0000 Subject: Fix [Bug 2328657] by explicitly excluding hacky zero-char chunks from intersection computation. Might deserve generalization to other tests. --- ChangeLog | 6 ++++++ generic/tkFont.c | 9 +++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6b43509..d9981d4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2009-07-21 Alexandre Ferrieux + + * generic/tkFont.c: Fix [Bug 2328657] by explicitly excluding + hacky zero-char chunks from intersection computation. Might + deserve generalization to other tests. + 2009-07-20 Donal K. Fellows * tests/clipboard.test (clipboard-6.2): [Bug 2824378]: Corrected diff --git a/generic/tkFont.c b/generic/tkFont.c index 70240c6..ba8b0c3 100644 --- a/generic/tkFont.c +++ b/generic/tkFont.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkFont.c,v 1.54 2009/05/13 21:33:32 patthoyts Exp $ + * RCS: @(#) $Id: tkFont.c,v 1.55 2009/07/20 23:29:05 ferrieux Exp $ */ #include "tkInt.h" @@ -2896,10 +2896,11 @@ Tk_IntersectTextLayout( result = 0; for (i = 0; i < layoutPtr->numChunks; i++) { - if (chunkPtr->start[0] == '\n') { + if ((chunkPtr->start[0] == '\n') || (chunkPtr->numBytes==0)) { /* - * Newline characters are not counted when computing area - * intersection (but tab characters would still be considered). + * Newline characters and empty chunks are not counted when + * computing area intersection (but tab characters would still be + * considered). */ chunkPtr++; -- cgit v0.12