Luxor.jl - resize canvas?

Is there a way to resize a canvas in Luxor.jl so it includes the bounding boxes of all elements?

Suppose I have the following code generating a drawing:

@png begin
  circle(Point(200, 200), 150, :fill)
end

Now the circle is partly outside the canvas. Is there a way to resize the canvas and move the object so the bounding boxes of all objects are on the canvas?

The size of the canvas is fixed when you create it, unfortunately, so you should set it to a reasonable size before you start drawing:

@png begin
  circle(Point(200, 200), 150, :fill)
end 800 800
1 Like