summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorferrieux <ferrieux@users.sourceforge.net>2009-07-20 23:29:05 (GMT)
committerferrieux <ferrieux@users.sourceforge.net>2009-07-20 23:29:05 (GMT)
commit90c0b929ea9c55d9561e04a5e3b1751e771386f3 (patch)
tree957c451ec81653dbecbd1a9920ce54ffa2c700ab /generic
parent85bda016225e43ef0893e26e17f391f8147e9f57 (diff)
downloadtk-90c0b929ea9c55d9561e04a5e3b1751e771386f3.zip
tk-90c0b929ea9c55d9561e04a5e3b1751e771386f3.tar.gz
tk-90c0b929ea9c55d9561e04a5e3b1751e771386f3.tar.bz2
Fix [Bug 2328657] by explicitly excluding hacky zero-char chunks from intersection computation. Might deserve generalization to other tests.
Diffstat (limited to 'generic')
-rw-r--r--generic/tkFont.c9
1 files changed, 5 insertions, 4 deletions
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++;