aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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;