Skip to content

Commit

Permalink
fix size issues
Browse files Browse the repository at this point in the history
  • Loading branch information
ffreyer committed Feb 7, 2024
1 parent b94080d commit b40f3f1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions WGLMakie/src/lines.jl
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ function serialize_three(scene::Scene, plot::Union{Lines, LineSegments})
notify(indices)
return output
else
sizehint!(indices[], length(output) + 2)
sizehint!(empty!(indices[]), length(output) + 2)
was_nan = true
for i in eachindex(output)
# dublicate first and last element of line selection
Expand All @@ -79,7 +79,7 @@ function serialize_three(scene::Scene, plot::Union{Lines, LineSegments})

push!(indices[], i)
end
isnan(last(output)) || push!(indices[], length(output))
push!(indices[], length(output))
notify(indices)

return output[indices[]]
Expand Down Expand Up @@ -128,7 +128,7 @@ function serialize_three(scene::Scene, plot::Union{Lines, LineSegments})
else
attributes[name] = lift(plot, indices, attr) do idxs, vals
# TODO: indices in js?
serialize_buffer_attribute(vals[idxs])
serialize_buffer_attribute(vals[min.(idxs, end)])
end
end
end
Expand Down

0 comments on commit b40f3f1

Please sign in to comment.