diff --git a/index.html b/index.html
index eff79b7..f6787de 100644
--- a/index.html
+++ b/index.html
@@ -318,6 +318,16 @@
+
+
Note: centering the image only works when using a canvas larger than the original image.
@@ -661,6 +671,8 @@
preserveRatio: true,
centerHorizontally: false,
centerVertically: false,
+ flipHorizontally: false,
+ flipVertically: false,
backgroundColor: "white",
scale: "1",
drawMode: "horizontal",
@@ -766,10 +778,6 @@
var ctx = canvas.getContext("2d");
image.ctx = ctx;
- // Make sure we're using the right canvas size
- //canvas.width = settings["screenWidth"];
- //canvas.height = settings["screenHeight"];
-
// Invert background if needed
if (settings["backgroundColor"] == "transparent") {
ctx.fillStyle = "rgba(0,0,0,0.0)";
@@ -830,6 +838,20 @@
invert(canvas, ctx);
}
}
+
+ // Flip image if needed
+ if (settings["flipHorizontally"]) {
+ ctx.save();
+ ctx.scale(-1, 1);
+ ctx.drawImage(canvas, -canvas.width, 0);
+ ctx.restore();
+ }
+ if (settings["flipVertically"]) {
+ ctx.save();
+ ctx.scale(1, -1);
+ ctx.drawImage(canvas, 0, -canvas.height);
+ ctx.restore();
+ }
}
// Handle inserting an image by pasting code