Skip to content

Commit 052cd3b

Browse files
committed
updated Morphic with current version
1 parent 3273476 commit 052cd3b

File tree

2 files changed

+2123
-347
lines changed

2 files changed

+2123
-347
lines changed

chart.html

+7-5
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,23 @@
1010

1111
window.onload = function () {
1212
world = new WorldMorph(document.getElementById('world'));
13+
world.worldCanvas.focus();
1314
world.setColor(new Color(255, 255, 255));
1415
chart = new ChartMorph();
1516
chart.setPosition(new Point(10, 10));
1617
world.add(chart);
17-
setInterval(loop, 1);
18+
loop();
1819
};
1920

20-
function loop() {
21-
world.doOneCycle();
22-
}
21+
function loop() {
22+
requestAnimationFrame(loop);
23+
world.doOneCycle();
24+
}
2325
</script>
2426
</head>
2527
<body>
2628
<canvas id="world" width="800" height="600" style="position: absolute;">
2729
<p>Your browser doesn't support canvas.</p>
2830
</canvas>
2931
</body>
30-
</html>
32+
</html>

0 commit comments

Comments
 (0)