Skip to content

Commit

Permalink
MAINT: Increase readability
Browse files Browse the repository at this point in the history
Reorder two elif so similar operators are consecutive.
  • Loading branch information
j-t-1 authored Jan 30, 2025
1 parent 4cb4e2c commit 99b8ea9
Showing 1 changed file with 3 additions and 17 deletions.
20 changes: 3 additions & 17 deletions pypdf/_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -1959,15 +1959,8 @@ def process_operation(operator: bytes, operands: List[Any]) -> None:
visitor_text(text, memo_cm, memo_tm, cmap[3], font_size)
text = ""
cm_matrix = mult(
[
float(operands[0]),
float(operands[1]),
float(operands[2]),
float(operands[3]),
float(operands[4]),
float(operands[5]),
],
cm_matrix,
[float(operand) for operand in operands[:6]],
cm_matrix
)
memo_cm = cm_matrix.copy()
memo_tm = tm_matrix.copy()
Expand Down Expand Up @@ -2031,14 +2024,7 @@ def process_operation(operator: bytes, operands: List[Any]) -> None:
_actual_str_size["str_widths"] = 0.0
elif operator == b"Tm":
check_crlf_space = True
tm_matrix = [
float(operands[0]),
float(operands[1]),
float(operands[2]),
float(operands[3]),
float(operands[4]),
float(operands[5]),
]
tm_matrix = [float(operand) for operand in operands[:6]]
str_widths = compute_str_widths(_actual_str_size["str_widths"])
_actual_str_size["str_widths"] = 0.0
elif operator == b"T*":
Expand Down

0 comments on commit 99b8ea9

Please sign in to comment.