- bbox = para->getGlyphBBox(cursor - 1);
- bbox = eRect(bbox.right(), 0, 2, size().height());
+ if (m_mode && cursor < glyphs)
+ {
+ /* in overwrite mode, when not at end of line, invert the current cursor position. */
+ para->setGlyphFlag(cursor, GS_INVERT);
+ eRect bbox = para->getGlyphBBox(cursor);
+ bbox = eRect(bbox.left(), 0, bbox.width(), size().height());
+ painter.fill(bbox);
+ } else
+ {
+ /* otherwise, insert small cursor */
+ eRect bbox;
+ if (cursor < glyphs)
+ {
+ bbox = para->getGlyphBBox(cursor);
+ bbox = eRect(bbox.left()-1, 0, 2, size().height());
+ } else if (cursor)
+ {
+ bbox = para->getGlyphBBox(cursor - 1);
+ bbox = eRect(bbox.right(), 0, 2, size().height());
+ } else
+ {
+ bbox = eRect(0, 0, 2, size().height());
+ }
+ painter.fill(bbox);
+ }