summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--generic/tkFont.c9
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 <ferrieux@users.sourceforge.net>
+
+ * 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 <dkf@users.sf.net>
* 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++;