From a4cd1f0072763a70b0562a055503ffab26488db2 Mon Sep 17 00:00:00 2001 From: hobbs Date: Wed, 24 Jul 2002 18:30:55 +0000 Subject: * generic/tkEntry.c (DisplayEntry): correct cursor position before calling Tk_SetCaretPos. (yamamoto) --- generic/tkEntry.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/generic/tkEntry.c b/generic/tkEntry.c index 87a726c..7d78d8a 100644 --- a/generic/tkEntry.c +++ b/generic/tkEntry.c @@ -12,7 +12,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkEntry.c,v 1.28 2002/04/05 08:43:22 hobbs Exp $ + * RCS: @(#) $Id: tkEntry.c,v 1.29 2002/07/24 18:30:55 hobbs Exp $ */ #include "tkInt.h" @@ -1897,11 +1897,11 @@ DisplayEntry(clientData) if ((entryPtr->state == STATE_NORMAL) && (entryPtr->flags & GOT_FOCUS)) { Tk_CharBbox(entryPtr->textLayout, entryPtr->insertPos, &cursorX, NULL, NULL, NULL); + cursorX += entryPtr->layoutX; + cursorX -= (entryPtr->insertWidth)/2; Tk_SetCaretPos(entryPtr->tkwin, cursorX, baseY - fm.ascent, fm.ascent + fm.descent); if (entryPtr->insertPos >= entryPtr->leftIndex) { - cursorX += entryPtr->layoutX; - cursorX -= (entryPtr->insertWidth)/2; if (cursorX < xBound) { if (entryPtr->flags & CURSOR_ON) { Tk_Fill3DRectangle(tkwin, pixmap, entryPtr->insertBorder, -- cgit v0.12