mirror of
https://github.com/Hopiu/fabric.js.git
synced 2026-05-20 03:11:52 +00:00
Fix titles of demos. Make raphael and fabric "simple shape" benchmark more fair (e.g. do not render borders and corners, since raphael doesn't render them either).
This commit is contained in:
parent
c57d61b17a
commit
1c4a755abc
9 changed files with 27 additions and 12 deletions
|
|
@ -67,20 +67,35 @@
|
|||
|
||||
var canvas = window.__canvas = new fabric.Element('canvas', {
|
||||
renderOnAddition: false,
|
||||
stateful: false
|
||||
stateful: false,
|
||||
HOVER_CURSOR: 'default'
|
||||
}),
|
||||
Circle = fabric.Circle,
|
||||
startTime = new Date(),
|
||||
circle;
|
||||
|
||||
|
||||
canvas.observe({
|
||||
'object:selected': function(e) {
|
||||
e.memo.target.setOpacity(0.75);
|
||||
},
|
||||
'mouse:up': function(e) {
|
||||
if (e.memo.target) {
|
||||
e.memo.target.setOpacity(1);
|
||||
canvas.renderAll();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
for (var i = numObjects; i--; ) {
|
||||
canvas.add(new Circle({
|
||||
var c = new Circle({
|
||||
radius: radius,
|
||||
left: getRandomNum(0, width),
|
||||
top: getRandomNum(0, height),
|
||||
fill: 'red',
|
||||
stroke: 'blue'
|
||||
}));
|
||||
});
|
||||
c.hasControls = c.hasBorders = false;
|
||||
canvas.add(c);
|
||||
}
|
||||
canvas.renderAll();
|
||||
canvas.calcOffset();
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Animating crosses (custom class)</title>
|
||||
<title>Animating crosses (custom class) — Fabric.js demos</title>
|
||||
<script src="../../dist/all.js"></script>
|
||||
<style>
|
||||
.canvas-container { border: 1px solid #ccc; display: inline-block; vertical-align: top; }
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Animating crosses (custom class)</title>
|
||||
<title>Customization — Fabric.js demos</title>
|
||||
<script src="../../dist/all.js"></script>
|
||||
<style>
|
||||
.canvas-container { border: 1px dotted #ccc; display: inline-block; vertical-align: top; }
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Event inspector</title>
|
||||
<title>Event inspector — Fabric.js demos</title>
|
||||
<script src="../../dist/all.js"></script>
|
||||
<style>
|
||||
.canvas-container { border: 1px solid #ccc; display: inline-block; vertical-align: top; }
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Animating crosses (custom class)</title>
|
||||
<title>Detecting object hovering — Fabric.js demos</title>
|
||||
<script src="../../dist/all.js"></script>
|
||||
<style>
|
||||
.canvas-container { border: 1px solid #ccc; display: inline-block; vertical-align: top; }
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Kitchensink demo</title>
|
||||
<title>Kitchensink — Fabric.js demos</title>
|
||||
<script src="../../dist/all.js"></script>
|
||||
<script src="../../lib/fonts/Delicious_500.font.js"></script>
|
||||
<style>
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Sliding ladybugs</title>
|
||||
<title>Sliding ladybugs — Fabric.js demos</title>
|
||||
<script src="../../dist/all.js"></script>
|
||||
<script>
|
||||
// polyfill by @paulirish
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Opacity & mouse move</title>
|
||||
<title>Opacity & mouse move — Fabric.js demos</title>
|
||||
<script src="../../dist/all.js"></script>
|
||||
<style>
|
||||
.canvas-container { border: 1px solid #ccc; display: inline-block; vertical-align: top; }
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Polaroid photos</title>
|
||||
<title>Polaroid photos — Fabric.js demos</title>
|
||||
<script src="../../dist/all.js"></script>
|
||||
<style>
|
||||
.canvas-container { border: 1px solid #ccc; display: inline-block; vertical-align: top; }
|
||||
|
|
|
|||
Loading…
Reference in a new issue