Skip to content

Fix Android text rendering crash - #13

Merged
medvednikov merged 5 commits into
masterfrom
fix/issue-12-android-text-crash
Sep 10, 2026
Merged

Fix Android text rendering crash#13
medvednikov merged 5 commits into
masterfrom
fix/issue-12-android-text-crash

Conversation

@medvednikov

Copy link
Copy Markdown
Member

Fixes #12.

Moves text-width measurement directly into the immediate renderer’s truncation loop, avoiding the callback invocation that crashes Android while preserving the binary-search ellipsis behavior.

Verification:

  • v fmt -verify ui/ui_immediate.c.v ui/ui_custom_test.v
  • v test ui (blocked: installed V compiler and V standard library are out of sync; time.Location methods are reported as duplicate.)

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 10, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-10T06:14:47.613991Z 44ceb97 New commits
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

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

Copy link
Copy Markdown

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: 2241f3b9b9

ℹ️ 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 ui/ui_immediate.c.v Outdated

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

Copy link
Copy Markdown

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: 44ceb9744c

ℹ️ 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 on lines +35 to +36
SetWindowPos(window, NULL, 0, 0, width, height,
SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE | SWP_FRAMECHANGED);

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 Avoid re-entrant refresh while resizing the native window

On the first native Windows build, this changes the initially frame-adjusted outer size to the raw 440x210 dimensions, synchronously producing WM_SIZE. The Windows refresh() path invokes build_screen before setting st.rendering = true, so its WM_SIZE handler re-enters refresh() while window_ready is still false because the assignment awaits this function's return. The nested build therefore repeats SetWindowPos, potentially recursing until stack overflow before the example is shown; set the readiness/reentrancy guard before resizing or configure the native window outside the build callback.

Useful? React with 👍 / 👎.

Comment thread ui/ui_immediate.c.v
Comment on lines +2018 to +2021
size := math.min(13.0, math.max(height - 8.0, 1.0))
return ButtonImageLayout{
visible: true
image: rect(5, (height - size) / 2, size, size)

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 Keep compact images inside narrow buttons

For a compact image-and-title button narrower than 18 pixels, the image size depends only on height and remains fixed at x = 5; for example, a 10×24 button gets an image rectangle spanning x=5 through x=18. The renderer clips only to the ancestor, not the button itself, so the icon paints outside the button and can overlap an adjacent control. The positive-title-area guard added after the earlier review suppresses only the text; clamp the image to the available width or omit it when no image area remains.

Useful? React with 👍 / 👎.

@medvednikov
medvednikov merged commit 610e62f into master Sep 10, 2026
0 of 5 checks passed
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.

android broken text rendering

1 participant