Skip to content

Commit

Permalink
fix changing input types (MakieOrg#2297)
Browse files Browse the repository at this point in the history
* fix changing input types

* add test
  • Loading branch information
SimonDanisch authored and t-bltg committed Dec 31, 2022
1 parent 7ba40ac commit f917417
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/interfaces.jl
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ function plot!(scene::Union{Combined, SceneLike}, P::PlotFunc, attributes::Attri
FinalType, argsconverted = apply_convert!(PreType, attributes, converted)
converted_node = Observable(argsconverted)
input_nodes = convert.(Observable, args)
onany(kw_signal, lift(tuple, input_nodes...)) do kwargs, args
onany(kw_signal, input_nodes...) do kwargs, args...
# do the argument conversion inside a lift
result = convert_arguments(FinalType, args...; kwargs...)
finaltype, argsconverted_ = apply_convert!(FinalType, attributes, result) # avoid a Core.Box (https://docs.julialang.org/en/v1/manual/performance-tips/#man-performance-captured)
Expand Down
8 changes: 8 additions & 0 deletions test/conversions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,14 @@ using Makie:

end

@testset "changing input types" begin
input = Observable{Any}(decompose(Point2f, Circle(Point2f(0), 2f0)))
f, ax, pl = mesh(input)
m = Makie.triangle_mesh(Circle(Point2f(0), 1f0))
input[] = m
@test pl[1][] == m
end

@testset "to_vertices" begin
X1 = [Point(rand(3)...) for i = 1:10]
V1 = to_vertices(X1)
Expand Down

0 comments on commit f917417

Please sign in to comment.