summaryrefslogtreecommitdiffstats
path: root/generic/tkTextMark.c
diff options
context:
space:
mode:
Diffstat (limited to 'generic/tkTextMark.c')
-rw-r--r--generic/tkTextMark.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/generic/tkTextMark.c b/generic/tkTextMark.c
index ff3ef44..3e97d7f 100644
--- a/generic/tkTextMark.c
+++ b/generic/tkTextMark.c
@@ -10,7 +10,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkTextMark.c,v 1.4 1999/12/14 06:52:33 hobbs Exp $
+ * RCS: @(#) $Id: tkTextMark.c,v 1.5 2002/04/05 08:43:22 hobbs Exp $
*/
#include "tkInt.h"
@@ -526,12 +526,16 @@ TkTextInsertDisplayProc(chunkPtr, x, y, height, baseline, display, dst, screenY)
if ((x + halfWidth) < 0) {
/*
- * The insertion cursor is off-screen. Just return.
+ * The insertion cursor is off-screen.
+ * Indicate caret at 0,0 and return.
*/
+ Tk_SetCaretPos(textPtr->tkwin, 0, 0, height);
return;
}
+ Tk_SetCaretPos(textPtr->tkwin, x - halfWidth, screenY, height);
+
/*
* As a special hack to keep the cursor visible on mono displays
* (or anywhere else that the selection and insertion cursors
@@ -542,12 +546,12 @@ TkTextInsertDisplayProc(chunkPtr, x, y, height, baseline, display, dst, screenY)
if (textPtr->flags & INSERT_ON) {
Tk_Fill3DRectangle(textPtr->tkwin, dst, textPtr->insertBorder,
- x - textPtr->insertWidth/2, y, textPtr->insertWidth,
- height, textPtr->insertBorderWidth, TK_RELIEF_RAISED);
+ x - halfWidth, y, textPtr->insertWidth, height,
+ textPtr->insertBorderWidth, TK_RELIEF_RAISED);
} else if (textPtr->selBorder == textPtr->insertBorder) {
Tk_Fill3DRectangle(textPtr->tkwin, dst, textPtr->border,
- x - textPtr->insertWidth/2, y, textPtr->insertWidth,
- height, 0, TK_RELIEF_FLAT);
+ x - halfWidth, y, textPtr->insertWidth, height,
+ 0, TK_RELIEF_FLAT);
}
}