Skip to content

Commit f5e7e32

Browse files
committed
Adjust examples to work on LuaJIT
1 parent 42d2c32 commit f5e7e32

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

content/examples/snakes.sil

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ local snakeimg = SILE.resolveFile(snake)
88
snakeGlue.width = SILE.types.length("0pt plus 100000pt")
99
function snakeGlue:outputYourself (typesetter, line)
1010
local scaledWidth = self.width.length
11-
if line.ratio and line.ratio < 0 and self.width.shrink > 0 then
11+
if line.ratio and line.ratio < 0 and self.width.shrink:tonumber() > 0 then
1212
scaledWidth = scaledWidth + self.width.shrink * line.ratio
13-
elseif line.ratio and line.ratio > 0 and self.width.stretch > 0 then
13+
elseif line.ratio and line.ratio > 0 and self.width.stretch:tonumber() > 0 then
1414
scaledWidth = scaledWidth + self.width.stretch * line.ratio
1515
end
16-
if scaledWidth <= 12 then return end
16+
if scaledWidth:tonumber() <= 12 then return end
1717
SILE.outputter:drawImage(snakeimg, typesetter.frame.state.cursorX, typesetter.frame.state.cursorY - 12, scaledWidth, 12);
1818
typesetter.frame:advanceWritingDirection(scaledWidth)
1919
end

0 commit comments

Comments
 (0)