Skip to content

Commit 4858089

Browse files
committed
Fix a bug with bidirectional reordering
1 parent ef08bfa commit 4858089

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,9 +210,10 @@ public LineLayoutResult layout(LayoutContext layoutContext) {
210210
children.add(new TextRenderer((TextRenderer) renderer));
211211
((TextRenderer) children.get(children.size() - 1)).line = new GlyphLine(((TextRenderer) children.get(children.size() - 1)).line);
212212
GlyphLine gl = ((TextRenderer) children.get(children.size() - 1)).line;
213-
gl.end = gl.start;
213+
gl.glyphs = new ArrayList<>();
214+
gl.end = gl.start = 0;
214215
while (pos < reorderedLine.size() && reorderedLine.get(pos).renderer == renderer) {
215-
gl.set(gl.end, reorderedLine.get(pos).glyph);
216+
gl.add(reorderedLine.get(pos).glyph);
216217
gl.end++;
217218
pos++;
218219
}

0 commit comments

Comments
 (0)