From 3183475903fb6d9d7911461e0790205cbae9d24d Mon Sep 17 00:00:00 2001 From: Alex Riss <00alexx@riss.at> Date: Wed, 29 Sep 2021 15:56:17 +0200 Subject: [PATCH] bug fixes --- src/ChemfilesViewer.jl | 4 ++-- test/runtests.jl | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/ChemfilesViewer.jl b/src/ChemfilesViewer.jl index a3bc4a4..ed31cdc 100644 --- a/src/ChemfilesViewer.jl +++ b/src/ChemfilesViewer.jl @@ -335,7 +335,7 @@ end Call [`render_molecule`](@ref) for the last used output plot. """ function render_molecule!(molecule::Chemfiles.Frame; options::AbstractDict{String,<:Any}=Dict{String,Any}(), output::String="") - return render_molecule(molecule, chemviewer_id=chemviewer_id, options=options, output=output) + return render_molecule(molecule, chemviewer_id=current_chemviewer_id, options=options, output=output) end @@ -405,7 +405,7 @@ If the `chemviewer_id` is not specified, the most recent instance is used. function save_image(filename::AbstractString; chemviewer_id::String="") window_obs, chemviewer_id = get_reference(chemviewer_id) if typeof(window_obs) == Blink.Window - img_base64 = @js window getPngString($chemviewer_id) + img_base64 = @js window_obs getPngString($chemviewer_id) elseif typeof(window_obs) == BiObservable job_id = string(UUIDs.uuid4()) global jobs[job_id] = Job(false, Dict("command" => "getPngString", "filename" => filename)) diff --git a/test/runtests.jl b/test/runtests.jl index e8b03de..726aa75 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -19,7 +19,7 @@ using Test d["atoms"][1]["color"] = "#f00000" d["atoms"][1]["label"] = "Important atom" d["atoms"][1]["radius"] = 1.0 - viewer_id = render_dict_molecule(d, chemviewer_id=viewer_id) + render_dict_molecule(d, chemviewer_id=viewer_id) # change view set_camera_position!("x", "-") @@ -33,7 +33,7 @@ using Test end save_image("test.png") - close(ChemfilesViewer.get_window_chemviewer_id(viewer_id)[1]) + close(ChemfilesViewer.get_reference(viewer_id)[1]) @test filesize("test.png") > 100000 end