mirror of
https://github.com/Hopiu/fabric.js.git
synced 2026-05-27 14:33:59 +00:00
Few code tweaks in demos.
This commit is contained in:
parent
81c4303295
commit
e48e341105
3 changed files with 12 additions and 8 deletions
|
|
@ -67,17 +67,20 @@
|
|||
}
|
||||
});
|
||||
|
||||
canvas.add(new Cross({ top: 100, left: 100 }));
|
||||
canvas.add(new Cross({ top: 140, left: 230 }));
|
||||
canvas.add(new Cross({ top: 300, left: 210 }));
|
||||
canvas.add(new Cross({ top: 40, left: 400 }));
|
||||
canvas.add(new Cross({ top: 450, left: 400 }));
|
||||
canvas.add(
|
||||
new Cross({ top: 100, left: 100 }),
|
||||
new Cross({ top: 140, left: 230 }),
|
||||
new Cross({ top: 300, left: 210 }),
|
||||
new Cross({ top: 40, left: 400 }),
|
||||
new Cross({ top: 450, left: 400 })
|
||||
);
|
||||
|
||||
setTimeout(function animate() {
|
||||
canvas.forEachObject(function(obj){ obj.animateWidthHeight() });
|
||||
canvas.renderAll();
|
||||
setTimeout(animate, 10);
|
||||
}, 10);
|
||||
|
||||
</script>
|
||||
|
||||
<script>
|
||||
|
|
|
|||
|
|
@ -39,11 +39,10 @@
|
|||
<canvas id="c" width="800" height="400"></canvas>
|
||||
|
||||
<script id="main">
|
||||
var canvas = new fabric.Canvas('c');
|
||||
var canvas = new fabric.Canvas('c', { selection: false });
|
||||
|
||||
setInterval(function() {
|
||||
fabric.Image.fromURL('ladybug.png', function(img) {
|
||||
img.selectable = false;
|
||||
img.set('left', fabric.util.getRandomInt(200, 600)).set('top', -50);
|
||||
img.movingLeft = !!Math.round(Math.random());
|
||||
canvas.add(img);
|
||||
|
|
|
|||
|
|
@ -7,4 +7,6 @@ body { font-family: Garamond, "Hoefler Text", "Times New Roman", Times, serif; m
|
|||
#header li a { display: inline-block; padding: 10px; color: pink; font-variant: small-caps; text-decoration: none; }
|
||||
#header li a:hover, #header li a:focus { text-decoration: underline; }
|
||||
|
||||
#bd-wrapper { padding: 10px; }
|
||||
#bd-wrapper { padding: 10px; }
|
||||
|
||||
pre { margin-top: 0; font-size: 12px; vertical-align: top; }
|
||||
Loading…
Reference in a new issue