Skip to content

Commit ccd91f6

Browse files
fix method order in LayoutElement
1 parent 0dfb6f1 commit ccd91f6

1 file changed

Lines changed: 35 additions & 35 deletions

File tree

borb/pdf/layout_element/layout_element.py

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -158,41 +158,6 @@ def __init__(
158158
# PRIVATE
159159
#
160160

161-
def _arc_points(
162-
self,
163-
x: int,
164-
y: int,
165-
w: int,
166-
h: int,
167-
start_angle: int,
168-
end_angle: int,
169-
line_width: int,
170-
) -> typing.List[typing.Tuple[float, float, int]]:
171-
if 0 <= start_angle < 90:
172-
radius: int = self.__border_radius_top_right
173-
cx: int = x + w - radius
174-
cy: int = y + h - radius
175-
elif 90 <= start_angle < 180:
176-
radius = self.__border_radius_top_left
177-
cx = x + radius
178-
cy = y + h - radius
179-
elif 180 <= start_angle < 270:
180-
radius = self.__border_radius_bottom_left
181-
cx = x + radius
182-
cy = y + radius
183-
else:
184-
radius = self.__border_radius_bottom_right
185-
cx = x + w - radius
186-
cy = y + radius
187-
return [
188-
(
189-
round(cx + math.cos(math.radians(a)) * radius, 7),
190-
round(cy + math.sin(math.radians(a)) * radius, 7),
191-
line_width,
192-
)
193-
for a in range(start_angle, end_angle)
194-
]
195-
196161
@staticmethod
197162
def _append_newline_to_content_stream(page: Page) -> None:
198163
if "Contents" not in page:
@@ -267,6 +232,41 @@ def _append_to_content_stream(
267232
last_stream["DecodedBytes"] += bytes_to_append
268233
return
269234

235+
def _arc_points(
236+
self,
237+
x: int,
238+
y: int,
239+
w: int,
240+
h: int,
241+
start_angle: int,
242+
end_angle: int,
243+
line_width: int,
244+
) -> typing.List[typing.Tuple[float, float, int]]:
245+
if 0 <= start_angle < 90:
246+
radius: int = self.__border_radius_top_right
247+
cx: int = x + w - radius
248+
cy: int = y + h - radius
249+
elif 90 <= start_angle < 180:
250+
radius = self.__border_radius_top_left
251+
cx = x + radius
252+
cy = y + h - radius
253+
elif 180 <= start_angle < 270:
254+
radius = self.__border_radius_bottom_left
255+
cx = x + radius
256+
cy = y + radius
257+
else:
258+
radius = self.__border_radius_bottom_right
259+
cx = x + w - radius
260+
cy = y + radius
261+
return [
262+
(
263+
round(cx + math.cos(math.radians(a)) * radius, 7),
264+
round(cy + math.sin(math.radians(a)) * radius, 7),
265+
line_width,
266+
)
267+
for a in range(start_angle, end_angle)
268+
]
269+
270270
@staticmethod
271271
def _begin_marked_content_with_dictionary(
272272
page: Page,

0 commit comments

Comments
 (0)