Skip to content

Implement #3168#3173

Draft
halx99 wants to merge 36 commits into
devfrom
input-field
Draft

Implement #3168#3173
halx99 wants to merge 36 commits into
devfrom
input-field

Conversation

@halx99
Copy link
Copy Markdown
Collaborator

@halx99 halx99 commented May 19, 2026

Describe your changes

Issue ticket number and link

Checklist before requesting a review

For each PR

  • Add Copyright if it missed:
    - "Copyright (c) 2019-present Axmol Engine contributors (see AUTHORS.md)."

  • I have performed a self-review of my code.

    Optional:

    • I have checked readme and add important infos to this PR.
    • I have added/adapted some tests too.

For core/new feature PR

  • I have checked readme and add important infos to this PR.
  • I have added thorough tests.

Axmol 3.x ------------------------------------------------------------

For each 3.x PR

  • Check the '#include "axmol.h"' and replace it with the needed headers.

@halx99 halx99 added this to the 3.0.0 milestone May 19, 2026
@halx99 halx99 linked an issue May 19, 2026 that may be closed by this pull request
@halx99 halx99 changed the title Input field Implement #3168 May 19, 2026
@halx99
Copy link
Copy Markdown
Collaborator Author

halx99 commented May 19, 2026

@codex review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 211c215351

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread axmol/ui/UIWidget.cpp Outdated
Comment thread extensions/scripting/lua-bindings/auto/axlua_ui_auto.cpp Outdated
@halx99
Copy link
Copy Markdown
Collaborator Author

halx99 commented May 20, 2026

/clang-format

@halx99
Copy link
Copy Markdown
Collaborator Author

halx99 commented May 20, 2026

@codex review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d2aff1905b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread extensions/sceneio/src/sceneio/WidgetReader/WidgetReader.cpp Outdated
Comment thread axmol/ui/UIButton.cpp Outdated
Comment thread axmol/ui/UIWidget.cpp Outdated
Comment thread axmol/ui/InputField.cpp Outdated
@halx99
Copy link
Copy Markdown
Collaborator Author

halx99 commented May 20, 2026

/clang-format

@halx99
Copy link
Copy Markdown
Collaborator Author

halx99 commented May 21, 2026

@codex review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: aa51937953

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread axmol/ui/InputField.cpp
int numOfBytes = 0;
while ((ch = *text) != 0x0)
{
AX_BREAK_IF(!ch || charCount > charLimit);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Enforce char limit before consuming next UTF-8 character

The truncation helper allows one extra character because it stops only when charCount > charLimit, not when it reaches the limit. When insertText clips pasted/IME input to the remaining capacity, this off-by-one lets _inputText grow beyond _charLimit by one UTF-8 character (e.g., remaining=1 still accepts 2 chars), leaving the widget in an invalid state until later edits.

Useful? React with 👍 / 👎.

Comment thread axmol/ui/InputField.cpp
Comment on lines +394 to +395
_passwordCharWidth = measureText(_passwordChar).width;
_layoutDirty = true;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Refresh cursor metrics after changing font size

setFontSize updates the render font but does not recompute _lineHeight (or resize the cursor to the new line height), even though cursor placement/selection geometry depends on _lineHeight. After changing font size at runtime, caret position, selection rectangles, and vertical cursor movement are computed from stale metrics and become visibly misaligned.

Useful? React with 👍 / 👎.

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.

Unify Input control: ui::TextField, TextFieldTTF, ui::TextFieldEx

2 participants