Skip to content

Commit c788625

Browse files
committed
Update act2model.json
The bug is fixed.The second atom is restored to its earlier position when reshown and does not disturb the first atom when hidden.However I have used a very crude method of storing the position parameters of the second atom.I stored them in velocity of the first atom as it didn't create any problem.the fix can be improved by using global variables to store the position parameter.
1 parent f3b3051 commit c788625

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

act2model.json

+5-4
Original file line numberDiff line numberDiff line change
@@ -36,18 +36,19 @@
3636
],
3737
"propertiesToRetain": [],
3838
"parameters": [
39-
{
39+
{
4040
"name": "show-second-atom",
4141
"initialValue": false,
4242
"onChange": [
4343
"if (value) {",
4444
" addAtom({ element:2,",
45-
" x: 1.34,",
46-
" y: 1.23,",
45+
" x: getAtomProperties(0).vx,",
46+
" y: getAtomProperties(0).vy,",
4747
" charge:2,",
4848
" vx: 0,",
4949
" vy: 0});",
50-
"} else {",
50+
"} else {","setAtomProperties(0,{vx:getAtomProperties(1).x , vy:getAtomProperties(1).y});",
51+
5152
" removeAtom(1);",
5253
"}"
5354
]

0 commit comments

Comments
 (0)