mirror of
https://github.com/storytold/pdfcraft.git
synced 2026-10-30 04:58:34 -06:00
Review on #4862 found two mismatches between the on-page field editor and the field's appearance: - Comb fields: the editor sized them as single-line text (20.87 pt for a 500 x 30 comb) while the appearance uses 4-12 pt from the cell height. The comb test is now `Field::is_comb` and the comb size `appearance::comb_auto_text_size`, both shared by the appearance and `forms_ui::field_text_size`. The editor's test was looser (it ignored Multiline and Password); it now matches the page's. - Tall fields: `field_text_size` capped at 300 pt and the three call sites clamped the screen font to 64. Both are gone; `field_screen_font` scales by zoom and bounds the result at MAX_SCREEN_FONT (256 screen points) so a glyph stays well inside the font atlas. A non-finite comb height now gives 4 pt, as single-line auto-size does. Test: it::forms::the_field_editor_sizes_auto_size_text_as_the_page_does. With the comb change reverted the comb assertion fails (20.87 vs 12); with the 300/64 caps restored the 100 pt assertion fails. Also fixes it::forms::dragging_over_another_fields_text_focuses_it_and_selects_from_the_press, which the previous commit broke: the name field now auto-sizes to 13.9 pt instead of 12, so the press point 30 px in fell on "A|da"; it is now 38 px in, inside "Ad|a" as the test intends. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SqmHYx8FiWM5PcsoiErgp9