Skip to content

Conversation

@bommbo
Copy link

@bommbo bommbo commented Jan 7, 2026

When switching between Block and I-beam cursor shapes on wide characters (e.g. Chinese), the cursor area was too narrow due to using _fontWidth instead of the actual character pixel width. This caused visual artifacts
such as partial cursor remnants or incomplete redraw.

This change uses QFontMetrics::horizontalAdvance() to get the true width of the character under the cursor, while preserving the existing -1/+1 adjustment to maintain I-beam visibility under sub-pixel rendering.

When switching between Block and I-beam cursor shapes on wide characters
(e.g. Chinese), the cursor area was too narrow due to using _fontWidth
instead of the actual character pixel width. This caused visual
artifacts
such as partial cursor remnants or incomplete redraw.

This change uses QFontMetrics::horizontalAdvance() to get the true width
of the character under the cursor, while preserving the existing -1/+1
adjustment to maintain I-beam visibility under sub-pixel rendering.
@bommbo
Copy link
Author

bommbo commented Jan 7, 2026

qterminal

before
test1

after
test2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant