From decd44ff326c34186124c351c78af7dbb0bfd925 Mon Sep 17 00:00:00 2001 From: drh Date: Fri, 17 Aug 2001 21:08:28 +0000 Subject: 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. --- generic/tkCanvText.c | 8 ++++---- 1 file 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 @@ -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; } -- cgit v0.12