aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJez Ng <me@jezng.com>2013-07-10 00:13:56 -0700
committerJez Ng <me@jezng.com>2013-07-10 15:27:13 -0700
commita5e793cdbe977e7908512cc0fa5f9b329bcccc06 (patch)
tree0c2295287addee9d7baabcad20b5e8f50c340933
parent9e484ca054e5c7b6189d893496c36ea9e4fd43f1 (diff)
Add workaround for FF.
-rw-r--r--src/library_sdl.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/library_sdl.js b/src/library_sdl.js
index 21738cf5..104dcd53 100644
--- a/src/library_sdl.js
+++ b/src/library_sdl.js
@@ -1040,7 +1040,9 @@ var LibrarySDL = {
else {
dstData.ctx.save();
dstData.ctx.scale(x < 0 ? -1 : 1, y < 0 ? -1 : 1);
- dstData.ctx.drawImage(srcData.canvas, 0, 0, w, h);
+ dstData.ctx.drawImage(srcData.canvas, w < 0 ? w : 0, h < 0 ? h : 0, Math.abs(w), Math.abs(h));
+ // XXX I think this should work according to the spec, but currently
+ // fails on FF: dstData.ctx.drawImage(srcData.canvas, 0, 0, w, h);
dstData.ctx.restore();
}
return ret;