Skip to content

Commit

Permalink
fix custom markershapes
Browse files Browse the repository at this point in the history
  • Loading branch information
BeastyBlacksmith committed Oct 9, 2024
1 parent 4cb02ae commit e1c0d1d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
4 changes: 3 additions & 1 deletion PlotsBase/ext/GRExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2052,7 +2052,9 @@ function gr_draw_markers(
ms = get_thickness_scaling(series) * _cycle(msize, i)
msw = get_thickness_scaling(series) * _cycle(strokewidth, i)
shape = _cycle(shapes, i)
shape = gr_get_markershape.(shape)
if !(shape isa Shape)
shape = gr_get_markershape.(shape)
end
for j rng
gr_draw_marker(
series,
Expand Down
3 changes: 3 additions & 0 deletions PlotsBase/src/Shapes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ function Shape(x::AVec{X}, y::AVec{Y}) where {X,Y}
return Shape(convert(Vector{X}, x), convert(Vector{Y}, y))
end

# make it broadcast like a scalar
Base.Broadcast.broadcastable(shape::Shape) = Ref(shape)

get_xs(shape::Shape) = shape.x
get_ys(shape::Shape) = shape.y
vertices(shape::Shape) = collect(zip(shape.x, shape.y))
Expand Down
2 changes: 1 addition & 1 deletion PlotsBase/test/test_animations.jl
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ end
circleplot(x, y, i, line_z = 1:n, cbar = false, framestyle = :zerolines)
end when i % 5 == 0 fps = 10

@test_throws LoadError macroexpand(
@test_throws ErrorException macroexpand(
@__MODULE__,
quote
@gif for i 1:n
Expand Down

0 comments on commit e1c0d1d

Please sign in to comment.