Skip to content

Commit 5655d66

Browse files
authored
MAINT: Increase readability
Reorder two elif so similar operators are consecutive.
1 parent 1f35711 commit 5655d66

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pypdf/_page.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -2095,9 +2095,6 @@ def process_operation(operator: bytes, operands: List[Any]) -> None:
20952095
process_operation(b"Tc", [operands[1]])
20962096
process_operation(b"T*", [])
20972097
process_operation(b"Tj", operands[2:])
2098-
elif operator == b"TD":
2099-
process_operation(b"TL", [-operands[1]])
2100-
process_operation(b"Td", operands)
21012098
elif operator == b"TJ":
21022099
# The space width may be smaller than the font width, so the width should be 95%.
21032100
_confirm_space_width = _space_width * 0.95
@@ -2111,6 +2108,9 @@ def process_operation(operator: bytes, operands: List[Any]) -> None:
21112108
and text[-1] != " "
21122109
):
21132110
process_operation(b"Tj", [" "])
2111+
elif operator == b"TD":
2112+
process_operation(b"TL", [-operands[1]])
2113+
process_operation(b"Td", operands)
21142114
elif operator == b"Do":
21152115
output += text
21162116
if visitor_text is not None:

0 commit comments

Comments
 (0)