summaryrefslogtreecommitdiffstats
path: root/tests/canvText.test
diff options
context:
space:
mode:
authorericm <ericm>2000-02-03 21:27:26 (GMT)
committerericm <ericm>2000-02-03 21:27:26 (GMT)
commit89c9f372d31b5e61756564807e468a9c3e1fa372 (patch)
tree5bbe3efa4585528a584178ddc5bd3eb3de508975 /tests/canvText.test
parent32c58211007ce985f1da733cc7426626692dedf9 (diff)
downloadtk-89c9f372d31b5e61756564807e468a9c3e1fa372.zip
tk-89c9f372d31b5e61756564807e468a9c3e1fa372.tar.gz
tk-89c9f372d31b5e61756564807e468a9c3e1fa372.tar.bz2
* tests/canvText.test: test for fix for bug #2525.
* generic/tkFont.c (Tk_ComputeTextLayout): Was erroneously setting the width of newline-only text display chunks to some arbitrary huge number, instead of 0; this was interfering with things like the canvas find enclosed feature. (bug #2525).
Diffstat (limited to 'tests/canvText.test')
-rw-r--r--tests/canvText.test17
1 files changed, 16 insertions, 1 deletions
diff --git a/tests/canvText.test b/tests/canvText.test
index abe5589..fd76894 100644
--- a/tests/canvText.test
+++ b/tests/canvText.test
@@ -6,7 +6,7 @@
# Copyright (c) 1998-1999 by Scriptics Corporation.
# All rights reserved.
#
-# RCS: @(#) $Id: canvText.test,v 1.8 1999/12/14 06:53:12 hobbs Exp $
+# RCS: @(#) $Id: canvText.test,v 1.9 2000/02/03 21:27:27 ericm Exp $
if {[lsearch [namespace children] ::tcltest] == -1} {
source [file join [pwd] [file dirname [info script]] defs.tcl]
@@ -504,6 +504,21 @@ restore showpage
end
%%EOF
"
+
+test canvText-18.1 {bug fix 2525, find enclosed on text with newlines} {
+ catch {destroy .c}
+ canvas .c
+ pack .c
+ .c delete all
+ .c create text 100 100 -text Hello\n -anchor nw
+ set bbox [.c bbox 1]
+ set x2 [lindex $bbox 2]
+ set y2 [lindex $bbox 3]
+ incr y2
+ update
+ .c find enclosed 99 99 [expr $x2 + $i] [expr $y2 + 1]
+} 1
+
# cleanup
::tcltest::cleanupTests
return