Skip to content

Commit

Permalink
Merge pull request #41 from JuliaPlots/sd/workless
Browse files Browse the repository at this point in the history
only render on update
  • Loading branch information
SimonDanisch authored May 19, 2020
2 parents 1e934fd + 5417787 commit 1be05e2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ FileIO = "1.1"
GeometryBasics = "0.2.3"
Hyperscript = "0.0.3"
ImageTransformations = "0.7, 0.8"
JSServe = "0.6"
JSServe = "0.6.6"
MakieGallery = "0.2.1"
MeshIO = "0.4"
Observables = "0.3"
Expand Down
7 changes: 4 additions & 3 deletions src/WGLMakie.jl
Original file line number Diff line number Diff line change
Expand Up @@ -170,10 +170,11 @@ function add_scene!(three, scene::Scene)
}
function render_all(){
render_scene($(js_scene));
// Schedule the next frame.
requestAnimationFrame(render_all);
}
requestAnimationFrame(render_all);
// render first frame
render_all();
// Render only when something updates!
on_update_observables_callbacks.push(render_all);
""")
end

Expand Down

0 comments on commit 1be05e2

Please sign in to comment.