Skip to content

Commit

Permalink
fix(packages): Keep crop mark package from initializing a frame nobod…
Browse files Browse the repository at this point in the history
…y may use
  • Loading branch information
alerque committed Nov 4, 2023
1 parent 37f5fac commit 17a6bb8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/crop.lua
Original file line number Diff line number Diff line change
Expand Up @@ -69,22 +69,22 @@ local function _outputCropMarks ()
SILE.outputter:drawRule(page:right() + bleed, page:bottom(), len, 0.5)
SILE.outputter:drawRule(page:right(), page:bottom() + bleed, 0.5, len)

SILE.call("hbox", {}, function ()
local statelen = #SILE.typesetter.state.nodes
local hbox = SILE.call("hbox", {}, function ()
SILE.settings:temporarily(function ()
SILE.call("noindent")
SILE.call("font", { family = "Libertinus Serif", size = bleed * 0.8, weight = 400, style = nil, features = nil })
SILE.call("crop:header")
end)
end)
local hbox = SILE.typesetter.state.nodes[#SILE.typesetter.state.nodes]
SILE.typesetter.state.nodes[#SILE.typesetter.state.nodes] = nil
pl.tablex.clear(SILE.typesetter.state.nodes, statelen)

SILE.typesetter.frame.state.cursorX = page:left() + bleed
SILE.typesetter.frame.state.cursorY = page:top() - bleed - len / 2 + 2
outcounter = outcounter + 1

if hbox then
for i=1,#(hbox.value) do hbox.value[i]:outputYourself(SILE.typesetter, {ratio=1}) end
for i = 1, #hbox.value do hbox.value[i]:outputYourself(SILE.typesetter, { ratio = 1 }) end
end
end

Expand Down

0 comments on commit 17a6bb8

Please sign in to comment.