Skip to content

Commit

Permalink
Fix bug where sliders were not reset when clicking reset p.
Browse files Browse the repository at this point in the history
  • Loading branch information
Datseris committed Apr 5, 2024
1 parent ed82d34 commit 6eb6ef9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "DynamicalSystems"
uuid = "61744808-ddfa-5f27-97ff-6e42cc95d634"
repo = "https://github.com/JuliaDynamics/DynamicalSystems.jl.git"
version = "3.3.6"
version = "3.3.7"

[deps]
Attractors = "f3fd9213-ca85-4dba-9dfd-7fc91308fec7"
Expand Down
9 changes: 5 additions & 4 deletions ext/src/interactive_trajectory.jl
Original file line number Diff line number Diff line change
Expand Up @@ -115,11 +115,12 @@ function DynamicalSystems.interactive_trajectory(
end
# what happens when the reset p button gets pressed
on(resetp.clicks) do clicks
# first, reset actual dynamical system parameters
set_parameters!(pds, p0)
# Also **visually** reset sliders to initial parameters
for k in keys(p0)
haskey(sliders, k) || continue
set_close_to!(sliders[k], p0[k])
# then also **visually** reset sliders to initial parameters
for (k, slider) in sliders # remember sliders is a dictionary
p0k = current_parameter(ds, k, p0)
set_close_to!(slider, p0k)
end
end
end
Expand Down

0 comments on commit 6eb6ef9

Please sign in to comment.