Skip to content

Commit

Permalink
chore(classes): Redo layout detection to catch more scenarios
Browse files Browse the repository at this point in the history
  • Loading branch information
alerque committed Feb 28, 2023
1 parent 573dfc2 commit 0ae15ca
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions classes/cabinding.lua
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,10 @@ local posterFrameset = {
}
}

class.firstContentFrame = "front"

class.defaultFrameset = spreadFrameset

class.firstContentFrame = "front"

function class:_init (options)

cabook._init(self, options)
Expand Down Expand Up @@ -83,20 +83,18 @@ function class:declareOptions ()
local binding
self:declareOption("binding", function (_, value)
if value then binding = value end
if binding == "print" then
self.defaultFrameset = posterFrameset
end
return binding
end)
self:declareOption("papersize", function (_, size)
if size then
self.papersize = size
local parsed = SILE.papersize(size)
if self.options.binding ~= "print" then
if binding == "print" or CASILE.layout == "print" then
self.defaultFrameset = posterFrameset
SILE.documentState.paperSize = { parsed[1], parsed[2] }
else
local spread = parsed[1] * 2 + SILE.measurement(CASILE.spine):tonumber()
SILE.documentState.paperSize = { spread, parsed[2] }
else
SILE.documentState.paperSize = { parsed[1], parsed[2] }
end
SILE.documentState.orgPaperSize = SILE.documentState.paperSize
SILE.newFrame({
Expand Down

0 comments on commit 0ae15ca

Please sign in to comment.