Browse Source

fix re-draw button

master
Fr3deric 6 years ago
parent
commit
4f9b41de20
  1. 10
      chaostest/connected-lines.html

10
chaostest/connected-lines.html

@ -28,6 +28,8 @@ function get_svg() {
window.onload = function() { window.onload = function() {
paper.install(window); paper.install(window);
paper.setup(document.getElementById('canvas')); paper.setup(document.getElementById('canvas'));
var editor;
rnd_params(); rnd_params();
draw(); draw();
@ -40,11 +42,13 @@ window.onload = function() {
a.click(); a.click();
}); });
document.getElementById('draw').addEventListener('click', function() { document.getElementById('new').addEventListener('click', function() {
rnd_params();
editor.setValue(params);
draw(); draw();
}); });
var editor = new JSONEditor(document.getElementById('params'), { editor = new JSONEditor(document.getElementById('params'), {
no_additional_properties: true, no_additional_properties: true,
disable_edit_json: true, disable_edit_json: true,
disable_properties: true, disable_properties: true,
@ -102,7 +106,7 @@ window.onload = function() {
<canvas id="canvas" style="width: 500px; height: 500px;" resize></canvas> <canvas id="canvas" style="width: 500px; height: 500px;" resize></canvas>
<hr> <hr>
<button id="download-svg">download svg</button> <button id="download-svg">download svg</button>
<button id="draw">draw</button> <button id="new">new</button>
<br> <br>
<div id="params"></div> <div id="params"></div>

Loading…
Cancel
Save