Skip to content

fix: text input caret#2807

Merged
Arufonsu merged 1 commit intoAscensionGameDev:mainfrom
Copperbane:main
Feb 15, 2026
Merged

fix: text input caret#2807
Arufonsu merged 1 commit intoAscensionGameDev:mainfrom
Copperbane:main

Conversation

@Copperbane
Copy link
Contributor

@Copperbane Copperbane commented Feb 9, 2026

Bug found after 0.8.0 beta-381 release.

This PR fixes #2771 - text input caret positioning issues in the Intersect client. It addresses problems where the cursor wouldn't update correctly when typing or editing text.

Key Changes

Label.cs - Refactors OnChildBoundsChanged to ensure the control always invalidates when text bounds change. The logic is simplified by inverting conditions and explicitly calling Invalidate() at the end of the method, plus adding Invalidate() to OnTextExceedsSize.

Text.cs - Improves GetCharacterPosition to correctly calculate character positions when MeasureText fails. It adds the _scale parameter to measurement calls and implements a fallback that manually calculates width for each character using a reference character ("n") when the renderer returns zero.

These changes ensure the text caret displays at the correct position and updates properly on text input.

@Arufonsu Arufonsu self-assigned this Feb 14, 2026
@Arufonsu Arufonsu self-requested a review February 14, 2026 23:52
@Arufonsu Arufonsu changed the title Fix Textbox Caret issue fix: fix: text input caret Feb 14, 2026
@Arufonsu Arufonsu changed the title fix: fix: text input caret fix: text input caret Feb 14, 2026
@Arufonsu Arufonsu added the bug Something isn't working label Feb 14, 2026
@Arufonsu Arufonsu linked an issue Feb 14, 2026 that may be closed by this pull request
2 tasks
Signed-off-by: Arufonsu <17498701+Arufonsu@users.noreply.github.com>
@Arufonsu Arufonsu merged commit 2e4900a into AscensionGameDev:main Feb 15, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: text input caret position not properly updated

2 participants

Comments