summaryrefslogtreecommitdiffstats
path: root/generic/tkCanvText.c
diff options
context:
space:
mode:
authordrh <drh@sqlite.org>2001-08-17 21:08:28 (GMT)
committerdrh <drh@sqlite.org>2001-08-17 21:08:28 (GMT)
commitdecd44ff326c34186124c351c78af7dbb0bfd925 (patch)
tree4028d7c80ac2a2e694cac8abdb6e94fcc9960a97 /generic/tkCanvText.c
parent77fdd33b6f58df7debc680e447508f50da6f9397 (diff)
downloadtk-decd44ff326c34186124c351c78af7dbb0bfd925.zip
tk-decd44ff326c34186124c351c78af7dbb0bfd925.tar.gz
tk-decd44ff326c34186124c351c78af7dbb0bfd925.tar.bz2
The selection highlighting of text objects in the canvas widget
was failing to include the last character of the selection. The "selection get" mechanism returned the right answer (so all the tests were passing) but the widget did not display correctly. This delta fixes the problem.
Diffstat (limited to 'generic/tkCanvText.c')
-rw-r--r--generic/tkCanvText.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/generic/tkCanvText.c b/generic/tkCanvText.c
index 2d462ee..ef57473 100644
--- a/generic/tkCanvText.c
+++ b/generic/tkCanvText.c
@@ -9,7 +9,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkCanvText.c,v 1.9 2001/07/03 06:03:44 hobbs Exp $
+ * RCS: @(#) $Id: tkCanvText.c,v 1.10 2001/08/17 21:08:28 drh Exp $
*/
#include <stdio.h>
@@ -771,7 +771,7 @@ DisplayCanvText(canvas, itemPtr, display, drawable, x, y, width, height)
}
if ((selFirstChar >= 0) && (selFirstChar <= selLastChar)) {
int xFirst, yFirst, hFirst;
- int xLast, yLast;
+ int xLast, yLast, wLast;
/*
* Draw a special background under the selection.
@@ -780,7 +780,7 @@ DisplayCanvText(canvas, itemPtr, display, drawable, x, y, width, height)
Tk_CharBbox(textPtr->textLayout, selFirstChar, &xFirst, &yFirst,
NULL, &hFirst);
Tk_CharBbox(textPtr->textLayout, selLastChar, &xLast, &yLast,
- NULL, NULL);
+ &wLast, NULL);
/*
* If the selection spans the end of this line, then display
@@ -793,7 +793,7 @@ DisplayCanvText(canvas, itemPtr, display, drawable, x, y, width, height)
height = hFirst;
for (y = yFirst ; y <= yLast; y += height) {
if (y == yLast) {
- width = xLast - x;
+ width = xLast + wLast - x;
} else {
width = textPtr->rightEdge - textPtr->leftEdge - x;
}