From 67830bde803020329a01b9eca1701ffb6d0b38be Mon Sep 17 00:00:00 2001 From: Jörn Zaefferer Date: Thu, 23 Apr 2009 22:14:47 +0000 Subject: effects: demo visualising easing functions, tuning --- demos/effect/easing.html | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'demos') diff --git a/demos/effect/easing.html b/demos/effect/easing.html index 52103d5e9..f5f30a288 100644 --- a/demos/effect/easing.html +++ b/demos/effect/easing.html @@ -33,6 +33,8 @@ canvas.height = 135; var ctx = canvas.getContext("2d"); ctx.fillStyle = "black"; + ctx.strokeStyle = "white"; + ctx.beginPath(); ctx.moveTo(10, 0); ctx.quadraticCurveTo(0, 0, 0, 10); @@ -44,18 +46,15 @@ ctx.lineTo(10, 0); ctx.fill(); - ctx.strokeStyle = "white"; ctx.beginPath(); ctx.moveTo(0, 100.5); ctx.lineTo(100, 100.5); ctx.stroke(); - var mod = 2; + ctx.lineWidth = 1.5; ctx.beginPath(); - $.each(new Array(100 * mod), function(position) { - var ease = impl(0, position, 0, 1, 100 * mod); - ctx.moveTo(position / mod, 100 - position / mod * ease); - ctx.lineTo(position / mod + 1, 99 - position / mod * ease); + $.each(new Array(100), function(position) { + ctx.lineTo(position, 100 - position * impl(0, position, 0, 1, 100)); }); ctx.stroke(); graph.click(function() { -- cgit v1.2.3