summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordrh@sqlite.org <drh>2001-08-17 21:08:28 (GMT)
committerdrh@sqlite.org <drh>2001-08-17 21:08:28 (GMT)
commit77a6342674dd0a1cc8656c403bb5f5295f6f673c (patch)
tree4028d7c80ac2a2e694cac8abdb6e94fcc9960a97
parentd974ca17661dd76a01c582bf97ecd3f62eb39a09 (diff)
downloadtk-77a6342674dd0a1cc8656c403bb5f5295f6f673c.zip
tk-77a6342674dd0a1cc8656c403bb5f5295f6f673c.tar.gz
tk-77a6342674dd0a1cc8656c403bb5f5295f6f673c.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.
-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;
}