+
Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions lib/sycamore/sycamore/transforms/bbox_merge.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,15 +152,17 @@ class MarkDropHeaderFooter(SingleThreadUser, NonGPUUser, Map):
"""

def __init__(self, child: Node, top: float = 0.05, bottom: Optional[float] = None, **resource_args):
super().__init__(child, f=MarkDropHeaderFooter.mark_drop_header_and_footer, args=[top, bottom], **resource_args)

@staticmethod
@timetrace("markHeadFoot")
def mark_drop_header_and_footer(parent: Document, top: float = 0.05, bottom: Optional[float] = None) -> Document:
if bottom is None:
bottom = top

lo = top
hi = 1.0 - bottom
super().__init__(child, f=MarkDropHeaderFooter.mark_drop_header_and_footer, args=[lo, hi], **resource_args)

@staticmethod
@timetrace("markHeadFoot")
def mark_drop_header_and_footer(parent: Document, lo: float, hi: float) -> Document:
for elem in parent.elements:
bbox = elem.data.get("bbox")
if (bbox is not None) and ((bbox[1] > hi) or (bbox[3] < lo)):
Expand Down
Loading
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载