Skip to content

Commit

Permalink
refactor(packages): Avoid hbox stealing hack in scalebox package
Browse files Browse the repository at this point in the history
  • Loading branch information
Omikhleia authored and Didier Willis committed Mar 29, 2023
1 parent d6b490c commit bbf0709
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion documentation/c05-packages.sil
Expand Up @@ -162,7 +162,7 @@ basic functionality to other packages and classes. Classes such as the
\subsection{rebox}
\package-documentation{rebox}

\section{scalebox}
\subsection{scalebox}
\package-documentation{scalebox}

\subsection{tableofcontents}
Expand Down
6 changes: 3 additions & 3 deletions packages/scalebox/init.lua
Expand Up @@ -13,9 +13,8 @@ function package:registerCommands ()
SILE.outputter:_ensureInit()
local pdf = require("justenoughlibtexpdf")

local hbox = SILE.call("hbox", {}, content)
table.remove(SILE.typesetter.state.nodes) -- Remove the box from queue
local xratio, yratio = SU.cast("number", options.xratio) or 1, SU.cast("number", options.yratio) or 1
local hbox, hlist = SILE.typesetter:makeHbox(content)
local xratio, yratio = SU.cast("number", options.xratio or 1), SU.cast("number", options.yratio or 1)
if xratio == 0 or yratio == 0 then
SU.error("Scaling ratio cannot be null")
end
Expand Down Expand Up @@ -55,6 +54,7 @@ function package:registerCommands ()
typesetter.frame:advanceWritingDirection(outputWidth)
end
})
SILE.typesetter:pushHlist(hlist)
end, "Scale content by some horizontal and vertical ratios")

end
Expand Down

0 comments on commit bbf0709

Please sign in to comment.