Skip to content

Commit

Permalink
fix(frames): Inherit class direction setting in new frames
Browse files Browse the repository at this point in the history
  • Loading branch information
alerque committed Feb 26, 2022
1 parent 5b23a86 commit 35c8a25
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
9 changes: 8 additions & 1 deletion classes/plain.lua
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,14 @@ plain.defaultFrameset = {
plain.firstContentFrame = "content"

plain.options.direction = function (value)
if value then plain.defaultFrameset.content.direction = value end
SILE.documentState.direction = value
if value then
for _, frame in pairs(plain.defaultFrameset) do
if not frame.direction then
frame.direction = value
end
end
end
end

function plain:init ()
Expand Down
4 changes: 4 additions & 0 deletions core/frame.lua
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ SILE.framePrototype = pl.class({

-- This gets called by Penlght when creating the frame instance
_init = function (self, spec, dummy)
local direction = SILE.documentState.direction
if direction then
self.direction = direction
end
self.constraints = {}
self.variables = {}
self.id = spec.id
Expand Down

0 comments on commit 35c8a25

Please sign in to comment.