From 4a9db77b41528d8d055b74f92ec46f3383837d90 Mon Sep 17 00:00:00 2001 From: cormullion Date: Tue, 5 Apr 2022 09:43:18 +0100 Subject: [PATCH] release v3.2.0 --- CHANGELOG.md | 3 ++- Project.toml | 2 +- docs/src/explanation/pathspolygons.md | 2 +- src/Path.jl | 4 +--- 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5334d46e..ef6cbe8d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # Changelog -## [v3.2.0] - ???????? +## [v3.2.0] - 2022-04-05 09:41:54 ### Added @@ -13,6 +13,7 @@ - check for dodgy corners in `polysmooth()` (thanks @arbitrandomuser!) - even more LaTeX characters (thanks @davibarreira!) - bug in ngon()-vertices-reversepath fixed +- `BoundingBox(path)` calculates boundingbox more precisely (fixes #213) ### Removed diff --git a/Project.toml b/Project.toml index 444ce1be..05f853a1 100644 --- a/Project.toml +++ b/Project.toml @@ -20,7 +20,7 @@ LaTeXStrings = "b964fa9f-0449-5b57-a5c2-d3ea65f4040f" Cairo = "0.7, 0.8, 1.0" Colors = "0.9, 0.10, 0.11, 0.12, 0.13, 0.14, 0.15, 0.16, 0.17, 1.0" FFMPEG = "0.4" -FileIO = "1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 1.10, 1.11, 1.12" +FileIO = "1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 1.10, 1.11, 1.12, 1.13" Juno = "0.7, 0.8" Rsvg = "1.0" Requires = "1" diff --git a/docs/src/explanation/pathspolygons.md b/docs/src/explanation/pathspolygons.md index 5529b25f..9c9aaa77 100644 --- a/docs/src/explanation/pathspolygons.md +++ b/docs/src/explanation/pathspolygons.md @@ -12,7 +12,7 @@ There's always a current path. It starts off being empty. A path can contain one or more sequences of straight lines and BeĢzier curves. You add straight lines to the current path using functions like `line()`, and add Bezier curves -using functions like `curve()`. You can can continue the +using functions like `curve()`. You can continue the path at a different location of the drawing using `move()`. Cairo keeps track of the current path, the current point, diff --git a/src/Path.jl b/src/Path.jl index 73eab9a7..e7b612e5 100644 --- a/src/Path.jl +++ b/src/Path.jl @@ -219,9 +219,7 @@ function BoundingBox(path::Path) end currentpoint = p.pt1 elseif p isa PathCurve - # Wikipedia says a Bezier curve is completely contained within the - # convex hull of its control points, so we can just do this: - phbbox = BoundingBox(polyhull([currentpoint, p.pt1, p.pt2, p.pt3])) + phbbox = BoundingBox(Luxor.get_bezier_points(BezierPathSegment(currentpoint, p.pt1, p.pt2, p.pt3))) if isapprox(boxdiagonal(bbox), 0.0) # bbox empty? bbox = phbbox else