From 1c4a755abc5021cc0968a06a1ccff82a72278192 Mon Sep 17 00:00:00 2001 From: kangax Date: Tue, 2 Aug 2011 20:31:43 -0400 Subject: [PATCH] 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). --- .../raphael_vs_fabric/simple_shapes.html | 23 +++++++++++++++---- demos/cross/index.html | 2 +- demos/customization/index.html | 2 +- demos/events/index.html | 2 +- demos/hovering/index.html | 2 +- demos/kitchensink/index.html | 2 +- demos/ladybug/index.html | 2 +- demos/opacity_mouse_move/index.html | 2 +- demos/polaroid/index.html | 2 +- 9 files changed, 27 insertions(+), 12 deletions(-) diff --git a/benchmarks/raphael_vs_fabric/simple_shapes.html b/benchmarks/raphael_vs_fabric/simple_shapes.html index fffd6919..ba680f6c 100644 --- a/benchmarks/raphael_vs_fabric/simple_shapes.html +++ b/benchmarks/raphael_vs_fabric/simple_shapes.html @@ -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(); diff --git a/demos/cross/index.html b/demos/cross/index.html index 21e87c31..36e8a320 100644 --- a/demos/cross/index.html +++ b/demos/cross/index.html @@ -2,7 +2,7 @@ - Animating crosses (custom class) + Animating crosses (custom class) — Fabric.js demos