From 911cc7211a33fca03bf17919c86a00b0762ec91a Mon Sep 17 00:00:00 2001 From: SimonDanisch Date: Tue, 17 Nov 2020 19:24:42 +0100 Subject: [PATCH 1/2] fix makielayout --- src/dictlike.jl | 15 ++++++++++++++- src/theming.jl | 2 +- test/ReferenceTests/src/image_download.jl | 5 ++--- 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/src/dictlike.jl b/src/dictlike.jl index 9e1121dad..30f699f6c 100644 --- a/src/dictlike.jl +++ b/src/dictlike.jl @@ -60,7 +60,20 @@ function Base.copy(attributes::Attributes) result = Attributes() for (k, v) in attributes # We need to create a new Signal to have a real copy - result[k] = Observable{Any}(to_value(v)) + result[k] = copy(v) + end + return result +end + +function Base.deepcopy(obs::Observable) + return Observable{Any}(to_value(obs)) +end + +function Base.deepcopy(attributes::Attributes) + result = Attributes() + for (k, v) in attributes + # We need to create a new Signal to have a real copy + result[k] = deepcopy(v) end return result end diff --git a/src/theming.jl b/src/theming.jl index 8e0fdf749..11429afcd 100644 --- a/src/theming.jl +++ b/src/theming.jl @@ -105,7 +105,7 @@ const minimal_default = Attributes( ), ) -const _current_default_theme = copy(minimal_default) +const _current_default_theme = deepcopy(minimal_default) function current_default_theme(; kw_args...) return merge!(Attributes(kw_args), _current_default_theme) diff --git a/test/ReferenceTests/src/image_download.jl b/test/ReferenceTests/src/image_download.jl index f843aecfe..3b0a2e25d 100644 --- a/test/ReferenceTests/src/image_download.jl +++ b/test/ReferenceTests/src/image_download.jl @@ -26,7 +26,7 @@ function download_refimages(tag=last_major_version()) images = basedir("refimages") isfile(images_tar) && rm(images_tar) isdir(images) && rm(images, recursive=true, force=true) - Downloads.download(url, images_tar) + Base.download(url, images_tar) Tar.extract(images_tar, images) return images end @@ -34,6 +34,5 @@ end # rm(joinpath(@__DIR__, "refimages"), force=true, recursive=true) -# +# # using Pkg.TOML - From c61d368e52348759ab8127564743e9aa302d8ba2 Mon Sep 17 00:00:00 2001 From: SimonDanisch Date: Tue, 17 Nov 2020 19:28:18 +0100 Subject: [PATCH 2/2] deepcopy theme --- src/theming.jl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/theming.jl b/src/theming.jl index 11429afcd..869a110ba 100644 --- a/src/theming.jl +++ b/src/theming.jl @@ -113,10 +113,11 @@ end function set_theme!(new_theme::Attributes) empty!(_current_default_theme) - new_theme = merge!(new_theme, minimal_default) + new_theme = merge!(new_theme, deepcopy(minimal_default)) merge!(_current_default_theme, new_theme) return end + function set_theme!(;kw_args...) set_theme!(Attributes(; kw_args...)) end