Skip to content

Commit

Permalink
Adjust examples to work on LuaJIT
Browse files Browse the repository at this point in the history
  • Loading branch information
alerque committed Jun 11, 2024
1 parent 42d2c32 commit f5e7e32
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions content/examples/snakes.sil
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ local snakeimg = SILE.resolveFile(snake)
snakeGlue.width = SILE.types.length("0pt plus 100000pt")
function snakeGlue:outputYourself (typesetter, line)
local scaledWidth = self.width.length
if line.ratio and line.ratio < 0 and self.width.shrink > 0 then
if line.ratio and line.ratio < 0 and self.width.shrink:tonumber() > 0 then
scaledWidth = scaledWidth + self.width.shrink * line.ratio
elseif line.ratio and line.ratio > 0 and self.width.stretch > 0 then
elseif line.ratio and line.ratio > 0 and self.width.stretch:tonumber() > 0 then
scaledWidth = scaledWidth + self.width.stretch * line.ratio
end
if scaledWidth <= 12 then return end
if scaledWidth:tonumber() <= 12 then return end
SILE.outputter:drawImage(snakeimg, typesetter.frame.state.cursorX, typesetter.frame.state.cursorY - 12, scaledWidth, 12);
typesetter.frame:advanceWritingDirection(scaledWidth)
end
Expand Down

0 comments on commit f5e7e32

Please sign in to comment.