From 2fb43552da43a273a20f947f9be012c8427d8b70 Mon Sep 17 00:00:00 2001 From: Caleb Maclennan Date: Fri, 17 Apr 2020 15:15:02 +0300 Subject: [PATCH] chore(measurements): Allow casting a length from a glue (#850) --- core/length.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/length.lua b/core/length.lua index b8482fcb0..298d937b1 100644 --- a/core/length.lua +++ b/core/length.lua @@ -19,6 +19,10 @@ return pl.class({ self.length = SILE.measurement(spec) elseif SU.type(spec) == "measurement" then self.length = spec + elseif SU.type(spec) == "glue" then + self.length = SILE.measurement(spec.width.length or 0) + self.stretch = SILE.measurement(spec.width.stretch or 0) + self.shrink = SILE.measurement(spec.width.shrink or 0) elseif type(spec) == "table" then self.length = SILE.measurement(spec.length or 0) self.stretch = SILE.measurement(spec.stretch or 0)