From 844f760fc716acd836dcc1589f5cff05a66fdc93 Mon Sep 17 00:00:00 2001 From: SimonDanisch Date: Fri, 23 Sep 2022 12:20:01 +0200 Subject: [PATCH 1/2] fix changing input types --- src/interfaces.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/interfaces.jl b/src/interfaces.jl index 0819d59118d..bdd2b4b3bfd 100644 --- a/src/interfaces.jl +++ b/src/interfaces.jl @@ -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) From aedbf312269b1418dd598b17b8c8a48f4d1930d7 Mon Sep 17 00:00:00 2001 From: SimonDanisch Date: Fri, 23 Sep 2022 12:28:33 +0200 Subject: [PATCH 2/2] add test --- test/conversions.jl | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/conversions.jl b/test/conversions.jl index 9c2fe868028..8c01def1a27 100644 --- a/test/conversions.jl +++ b/test/conversions.jl @@ -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)