Skip to content

fix(reader): contain YOLO translation bubbles within the bubble border - #1288

Merged
everpcpc merged 2 commits into
mainfrom
fix/translation-bubble-geometry
Oct 17, 2026
Merged

everpcpc merged 2 commits into
mainfrom
fix/translation-bubble-geometry

Conversation

@everpcpc

Copy link
Copy Markdown
Member

Problem

The bubble shape preference added in #1286 did not work out in practice:

  • With whole-bubble (YOLO) boxes, the rounded-rectangle text area spanned nearly the full box, so translations looked oversized; the ellipse shrank the text area to 0.5 of the box, making the same text too small.
  • The white blob was the detected box plus an outward feather band, so it painted over the bubble's own border line and left a blurry halo outside the bubble.
  • Horizontal font fitting was capped (4 iterations, at most ×0.7 per step), so longer translations failed to converge, overflowed the text area, and pressed against the bubble edge.

Fix

  • Drop the shape preference entirely; bubbles always render as rounded rectangles. The stale bubbleShape key in stored preferences is ignored on decode, and its three localization keys (Bubble Shape / Ellipse / Rounded Rectangle) are removed.
  • Whole-bubble boxes now keep the blob and its feather inside the detected box, so the bubble's own border line survives instead of being covered and blurred; text-tight (rt_detr) boxes keep the outward feather since the blob must grow past the glyphs.
  • The whole-bubble text area is a centered 0.5 of the box, keeping glyphs off the bubble's own padding.
  • Horizontal fitFont converges like the vertical path (×0.85 steps down to the 8pt floor) instead of giving up and overflowing.

Validation

  • make format, make build: iOS / macOS / tvOS all pass.
  • make localize run; ./misc/translate.py list reports no missing translations.
  • Manual verification on simulator pages detected by the YOLO model: bubble borders stay visible, no halo outside the bubble, translated text (horizontal and vertical) stays inside the bubble.

Remove the bubble shape preference (ellipse/roundedRect) and always
render rounded-rectangle backgrounds. For whole-bubble (YOLO) boxes the
blob and its feather now stay inside the detected box so the bubble's
own border line survives, the text area shrinks to a centered 0.5 of
the box, and horizontal font fitting converges instead of overflowing
the bubble edge.
Clamp the feather to half the box so the background survives on
whole-bubble boxes whose short edge is under twice the feather floor;
also fix an inverted subject in the conventions doc.
@everpcpc
everpcpc merged commit 3e8bba6 into main Oct 17, 2026
3 checks passed
@everpcpc
everpcpc deleted the fix/translation-bubble-geometry branch October 17, 2026 11:24
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