Merge pull request #1820 from diegozea/patch-1

It solves Shape bugs
This commit is contained in:
Michael Krabbe Borregaard 2018-10-30 15:17:11 +01:00 committed by GitHub
commit b0bd5c13a0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -491,7 +491,7 @@ function series_annotations_shapes!(series::Series, scaletype::Symbol = :pixels)
# with a list of custom shapes for each # with a list of custom shapes for each
msw,msh = anns.scalefactor msw,msh = anns.scalefactor
msize = Float64[] msize = Float64[]
shapes = Vector{Shape}(length(anns.strs)) shapes = Vector{Shape}(undef, length(anns.strs))
for i in eachindex(anns.strs) for i in eachindex(anns.strs)
str = _cycle(anns.strs,i) str = _cycle(anns.strs,i)
@ -509,7 +509,7 @@ function series_annotations_shapes!(series::Series, scaletype::Symbol = :pixels)
# and then re-scale a copy of baseshape to match the w/h ratio # and then re-scale a copy of baseshape to match the w/h ratio
maxscale = max(xscale, yscale) maxscale = max(xscale, yscale)
push!(msize, maxscale) push!(msize, maxscale)
baseshape = _cycle(get(anns.baseshape),i) baseshape = _cycle(anns.baseshape, i)
shapes[i] = scale(baseshape, msw*xscale/maxscale, msh*yscale/maxscale, (0,0)) shapes[i] = scale(baseshape, msw*xscale/maxscale, msh*yscale/maxscale, (0,0))
end end
series[:markershape] = shapes series[:markershape] = shapes