Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option to declare frames using coordinates (x, y) #1975

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions core/frame.lua
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,25 @@ SILE.framePrototype = pl.class({
return SILE.measurement(instance_self.variables[method].value)
end
end

-- Add definitions of width and height
for method in pairs(alldims) do
if spec[method] then
self:constrain(method, spec[method])
end
end

if self.x then
-- if not spec.width then spec.width = "" end
self:constrain("left", self.x .. "-(" .. spec.width .. "/2)")
self:constrain("right", self.x .. "+(" .. spec.width .. "/2)")
end
if self.y then
-- if not spec.height then spec.height = "" end
self:constrain("top", self.y .. "-(" .. spec.height .. "/2)")
self:constrain("bottom", self.y .. "+(" .. spec.height .. "/2)")
end

end
end,

Expand Down
Loading