Skip to content

Commit

Permalink
Better fading.
Browse files Browse the repository at this point in the history
  • Loading branch information
mbostock committed May 24, 2011
1 parent 8011c27 commit 4dd2e97
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion test/test-fade.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ function loop() {
if (i > frames) return;
context.globalAlpha = 1;
image1.render(context, function() {
context.globalAlpha = view.center()[2] % 1;
context.globalAlpha = 1 - Math.max(0, Math.min(1, 5 * (view.center()[2] % 1) - 2));
image2.render(context, function() {
util.log(__dirname + "/fade-" + i + ".png");
fs.writeFile(__dirname + "/fade-" + i + ".png", canvas.toBuffer(), function() {
Expand Down

0 comments on commit 4dd2e97

Please sign in to comment.