Skip to content

Commit c0cd7cd

Browse files
jakejackson1claude
andcommitted
Say plainly how a text input's value is fitted
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
1 parent a2749a9 commit c0cd7cd

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

‎src/Form.php‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1380,7 +1380,7 @@ private function fitStaticText($text, $width)
13801380
$width *= $size / $fit;
13811381

13821382
if ($textWidth > $width) {
1383-
// The longest start of the value that fits, reshaped each time as it may join differently when cut
1383+
// The longest start of the value that fits. Each cut is reshaped, as letters can join differently at the end
13841384
$fits = ['', null];
13851385
$shortest = 0;
13861386
$longest = mb_strlen($text, $this->mpdf->mb_enc);
@@ -1422,7 +1422,7 @@ private function shapeText($text)
14221422

14231423
/**
14241424
* The font size a text input's value is drawn at to fit its field: smaller in proportion when it is too wide, but
1425-
* not below half the field's size or 6pt, whichever is larger
1425+
* not below half the field's size or 6pt, whichever is larger, and never above the field's size
14261426
*
14271427
* @param float $size the field's font size, in points
14281428
* @param float $room the width the value has

‎tests/Mpdf/FormFieldShrinkTest.php‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@ public function testShapedValueIsDrawnWholeInASmallerFont()
7979
}
8080

8181
/**
82-
* An active field too wide for its value leaves the viewer to size the text, and its appearance draws the value
83-
* at the size that fits, no smaller than the minimum. The field keeps its whole value.
82+
* A value too wide for an active field leaves the viewer to size the text, and the appearance draws it at the size
83+
* that fits, no smaller than the minimum. The field keeps its whole value.
8484
*
8585
* @dataProvider activeFields
8686
*

0 commit comments

Comments
 (0)