Skip to content

Commit

Permalink
Update test to use non uniform scale
Browse files Browse the repository at this point in the history
git-svn-id: https://explorercanvas.googlecode.com/svn/trunk@65 fd59bba8-8519-0410-9389-e36bf2bdbbd6
  • Loading branch information
[email protected] committed Aug 21, 2009
1 parent fa4d9a8 commit b0120b8
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions testcases/draw-image-flip.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,30 +14,32 @@

function draw() {
var ctx = document.getElementById('c').getContext('2d');
var s = .25;
var w = 608 / 2;
var h = 380 / 2;

ctx.save();
ctx.translate(w, 0);
ctx.drawImage(img, 0, 0, w, h);
ctx.scale(s, s);
ctx.drawImage(img, 0, 0, w / s, h / s);
ctx.restore();

ctx.save();
ctx.translate(w, 0);
ctx.scale(-1, 1);
ctx.drawImage(img, 0, 0, w, h);
ctx.scale(-s, s);
ctx.drawImage(img, 0, 0, w / s, h / s);
ctx.restore();

ctx.save();
ctx.translate(w, 2 * h);
ctx.scale(1, -1);
ctx.drawImage(img, 0, 0, w, h);
ctx.scale(s, -s);
ctx.drawImage(img, 0, 0, w / s, h / s);
ctx.restore();

ctx.save();
ctx.translate(w, 2 * h);
ctx.scale(-1, -1);
ctx.drawImage(img, 0, 0, w, h);
ctx.scale(-s, -s);
ctx.drawImage(img, 0, 0, w / s, h / s);
ctx.restore();
};

Expand Down

0 comments on commit b0120b8

Please sign in to comment.