Skip to content

Commit 94c45e3

Browse files
Fix line with hyphenation width bug
1 parent 185a407 commit 94c45e3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

layout/src/main/java/com/itextpdf/layout/renderer/TextRenderer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ public TextLayoutResult layout(LayoutContext layoutContext) {
228228
String pos = hyph.getPostHyphenText(i);
229229
float currentHyphenationChoicePreTextWidth =
230230
getGlyphLineWidth(convertToGlyphLine(pre + hyphenationConfig.getHyphenSymbol()), fontSize, hScale, characterSpacing, wordSpacing);
231-
if (currentHyphenationChoicePreTextWidth + italicSkewAddition + boldSimulationAddition <= layoutBox.getWidth()) {
231+
if (currentLineWidth + currentHyphenationChoicePreTextWidth + italicSkewAddition + boldSimulationAddition <= layoutBox.getWidth()) {
232232
hyphenationApplied = true;
233233

234234
if (line.start == -1) {

0 commit comments

Comments
 (0)