From 35c8a255c2a19d4f25dc5f60e40d76a52d2ac601 Mon Sep 17 00:00:00 2001 From: Caleb Maclennan Date: Sat, 26 Feb 2022 13:59:01 +0300 Subject: [PATCH] fix(frames): Inherit class direction setting in new frames --- classes/plain.lua | 9 ++++++++- core/frame.lua | 4 ++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/classes/plain.lua b/classes/plain.lua index c044a9b88..6963b2168 100644 --- a/classes/plain.lua +++ b/classes/plain.lua @@ -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 () diff --git a/core/frame.lua b/core/frame.lua index 787e83faf..6a973a052 100644 --- a/core/frame.lua +++ b/core/frame.lua @@ -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