Skip to content

Commit

Permalink
Remove useless function
Browse files Browse the repository at this point in the history
  • Loading branch information
liZe committed Mar 16, 2024
1 parent 3110363 commit 018ff6b
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions weasyprint/draw.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,6 @@ def draw_page(page, stream):
draw_stacking_context(stream, stacking_context)


def draw_box_background_and_border(stream, page, box):
if isinstance(box, boxes.TableBox):
draw_table(stream, box)
else:
draw_background(stream, box.background)
draw_border(stream, box)


def draw_stacking_context(stream, stacking_context):
"""Draw a ``stacking_context`` on ``stream``."""
# See https://www.w3.org/TR/CSS2/zindex.html
Expand Down Expand Up @@ -123,7 +115,8 @@ def draw_stacking_context(stream, stacking_context):
boxes.InlineBlockBox, boxes.TableCellBox,
boxes.FlexContainerBox)):
# The canvas background was removed by layout_backgrounds
draw_box_background_and_border(stream, stacking_context.page, box)
draw_background(stream, box.background)
draw_border(stream, box)

with stacked(stream):
# dont clip the PageBox, see #35
Expand All @@ -142,8 +135,11 @@ def draw_stacking_context(stream, stacking_context):

# Point 4
for block in stacking_context.block_level_boxes:
draw_box_background_and_border(
stream, stacking_context.page, block)
if isinstance(block, boxes.TableBox):
draw_table(stream, block)
else:
draw_background(stream, block.background)
draw_border(stream, block)

# Point 5
for child_context in stacking_context.float_contexts:
Expand Down

0 comments on commit 018ff6b

Please sign in to comment.