On Update Script Executes Again on Mouse Key Up

eugbug shared this question 4 years ago
Needs Answer

I have a slider. When I click and drag, the value of the slider changes and the script executes, but it seems to execute again on mouse key up? It appears to be erratic. Not sure if it's my code at fault? The script attached to the slider "PlaneAngleDeg" calculates a new position for a point E, by evaluating the opposite and adjacent sides of a right angled triangle.

https://www.geogebra.org/cl...

Comments (3)

photo
1

try updateconstruction() in the second line of script

photo
1

Tried that but it didn't work. It works ok if I move the slider slowly, but if I move it fast, when it gets to 90 degrees, the calculated angle might be half that, but it's inconsistent and sometimes it works. I think the problem could be something to do with the value of the slider changing so fast that the script trips up over itself.

photo
1

It does work when typed from the command line though. ( sorry "input bar").

© 2023 International GeoGebra Institute