JuliaGraphics / Luxor.jl

Simple drawings using vector graphics; Cairo "for tourists!"
http://juliagraphics.github.io/Luxor.jl/
Other
588 stars 71 forks source link

Bounding Box for path does not seem right #213

Closed davibarreira closed 2 years ago

davibarreira commented 2 years ago

Hey @cormullion , it seems that the BoundingBox function is not properly defining the bound box for curves / paths.

d = Drawing(100,100,:svg)
origin()
newpath()
curve(O, O+Point(10,40), O+Point(40,-30))
setcolor("blue")
box(BoundingBox(storepath()),:fill)

newpath()
curve(O, O+Point(10,40), O+Point(40,-30))
setcolor("black")
strokepath()
finish()
d

Here is what I get: image

davibarreira commented 2 years ago

I think it's actually using the control points to bound... Is this the intended behavior? Causa I was looking for something that bounded the actually object. But I can see how this might be quite complicated.

cormullion commented 2 years ago

We could probably iterate over all the curves in the path to find the actual points covered, but I took the easy way out...😀

cormullion commented 2 years ago

Hopefully fixed in v3.2

davibarreira commented 2 years ago

Awesome! It worked :D

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.