Skip to content

Commit

Permalink
chore(measurements): Allow casting a length from a glue (#850)
Browse files Browse the repository at this point in the history
  • Loading branch information
alerque authored Apr 17, 2020
1 parent 7a96309 commit 2fb4355
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions core/length.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 2fb4355

Please sign in to comment.