Skip to content

Commit

Permalink
fix box bug
Browse files Browse the repository at this point in the history
  • Loading branch information
cormullion committed Feb 9, 2024
1 parent 36f8ebb commit 52a6238
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ See https://github.com/JuliaGraphics/Cairo.jl/pull/357.
- Aqua says TOML deps must be in alphabetical order :)
- remove @assert statements
- documents now built to https://github.com/JuliaGraphics/LuxorManual
- fixed bug in `box(pt, w, h, cr, :path)` (don't create new path)

### Removed

Expand Down
6 changes: 4 additions & 2 deletions src/shapes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ dimensions.
"""
function rect(xmin::Real, ymin::Real, w::Real, h::Real;
action = :none)
if action != :path
if action [:path, :none]
newpath()
end
Cairo.rectangle(_get_current_cr(), xmin, ymin, w, h)
Expand Down Expand Up @@ -262,7 +262,9 @@ function box(centerpoint::Point, width, height, cornerradii::Array;
p4end = Point(O.x + width/2 - cornerradii[4], O.y + height/2)

# start at bottom center then bottomleft→topleft→topright→bottomright
newpath()
if action [:path, :none]
newpath()
end
move(Point(O.x, O.y + height/2))

line(p1start)
Expand Down

0 comments on commit 52a6238

Please sign in to comment.