Skip to content

Commit

Permalink
Don't mesh a polygon in CairoMakie (#2398)
Browse files Browse the repository at this point in the history
* Don't mesh a polygon

* Test against polygon rasterization

Co-authored-by: Simon <[email protected]>
  • Loading branch information
jaakkor2 and SimonDanisch authored Nov 17, 2022
1 parent a5bf51d commit 2b9472e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CairoMakie/src/overrides.jl
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,8 @@ function polypath(ctx, polygon)
end
end

draw_poly(scene::Scene, screen::Screen, poly, polygon::Polygon) = draw_poly(scene, screen, poly, [polygon])

function draw_poly(scene::Scene, screen::Screen, poly, polygons::AbstractArray{<:Polygon})
model = poly.model[]
space = to_value(get(poly, :space, :data))
Expand Down
2 changes: 2 additions & 0 deletions CairoMakie/test/rasterization_tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ end
fig = Figure()
ax = Axis(fig[1,1])
lp = lines!(ax, vcat(1:10, 10:-1:1))
pts = Makie.GeometryBasics.Point2f[(0,0), (1,0), (0,1)]
pl = poly!(ax, Makie.GeometryBasics.Polygon(pts))

@testset "Unrasterized SVG" begin
@test svg_has_image(fig)
Expand Down

0 comments on commit 2b9472e

Please sign in to comment.