Skip to content

fix(driver): place right-aligned single-line text by its right end - #2769

Merged
oneo-me merged 2 commits into
mainfrom
agiox/fix-drawtext-alignment
Nov 29, 2026
Merged

oneo-me merged 2 commits into
mainfrom
agiox/fix-drawtext-alignment

Conversation

@oneo-me

@oneo-me oneo-me commented Nov 29, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Drawing.FillText and StrokeText drew TextAlignRight text as if it were start-aligned, against SetTextAlign's documentation; they now offset it by its width as TextAlignEnd and FillTextBox do. TextAlignLeft, like start, keeps the text's left end at x whatever its direction, which a test now pins. Every backend draws the op at X+X1, so the fix in the recorder covers them all.

Fixes #2766

Targets

  • Shared code (core, base, ui, tsx, the nsgo tool)
  • macOS
  • iOS
  • tvOS
  • watchOS
  • Android
  • Windows
  • Linux
  • Web
  • Mini programs
  • Docs or website only

Screenshots

None

Verification

  • head: 271616beb345297b91b6afa4f20e945a8fa16937
  • base: f59bb7a1663179b46eff96e9126749d25c5cece3
  • commands:
    • go tool nsgo check → 0
    • go tool nsgo test → 1 (5505 passed, 1 failed: TestQuickLookThumbnailDrawsTheAppOffTheScreen, "1 surfaces left open", unrelated to this change; it passed in three runs of its own)
    • go tool nsgo test -run TestQuickLookThumbnailDrawsTheAppOffTheScreen ./internal/platform/macos/ → 0
  • result: fail
  • not covered: the Android emulator, iOS, Windows, Linux and the browser jobs; the pixel test runs on macOS here and on Windows and Linux in CI

Checklist

  • The title is a Conventional Commit, such as fix(linux): keep the caret after a paste; a squash merge uses it as the commit subject.
  • Docs whose facts change are updated, and a capability users can see has a line in a changelog.d/ fragment, not in CHANGELOG.md.
  • New third-party code, assets and dependencies name their source and license.

🤖 Claude Opus 5.5

🤖 Generated with Claude Code

@oneo-me oneo-me self-assigned this Nov 29, 2026
@github-actions github-actions Bot added size/S bug Something isn't working local-ci-skipped documentation Improvements or additions to documentation core and removed bug Something isn't working local-ci-skipped labels Nov 29, 2026
@github-actions

github-actions Bot commented Nov 29, 2026 •

Copy link
Copy Markdown

The Local CI block declares fail for this pull request's head commit, so a maintainer audits the pull request before merging it.

@github-actions github-actions Bot added bug Something isn't working local-ci-fail The head commit declares failing local checks, so a maintainer audits it labels Nov 29, 2026
@oneo-me
oneo-me marked this pull request as ready for review November 29, 2026 14:55
@oneo-me
oneo-me merged commit a00be7c into main Nov 29, 2026
50 of 51 checks passed
@oneo-me
oneo-me deleted the agiox/fix-drawtext-alignment branch November 29, 2026 14:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working core documentation Improvements or additions to documentation local-ci-fail The head commit declares failing local checks, so a maintainer audits it size/S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Drawing.FillText ignores TextAlignRight and TextAlignLeft

1 participant