From 2e708963df2abbd2f4efedfcabf7a374e2d0e2a7 Mon Sep 17 00:00:00 2001 From: Dylan <31424592+littork@users.noreply.github.com> Date: Sun, 9 Dec 2018 07:47:01 -0700 Subject: [PATCH] Remove bad translation canvas.height / canvas.width only produces a slight black bar on the top of the image and is unnecessary --- docs/sample.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/sample.rst b/docs/sample.rst index 93a377b..6e2c540 100644 --- a/docs/sample.rst +++ b/docs/sample.rst @@ -125,26 +125,26 @@ Generates Rotated JPEG } else if (orientation == 5) { canvas.width = image.height; canvas.height = image.width; - ctx.translate(canvas.width, canvas.height / canvas.width); + ctx.translate(canvas.width, 0); ctx.rotate(Math.PI / 2); y = -canvas.width; ctx.scale(1, -1); } else if (orientation == 6) { canvas.width = image.height; canvas.height = image.width; - ctx.translate(canvas.width, canvas.height / canvas.width); + ctx.translate(canvas.width, 0); ctx.rotate(Math.PI / 2); } else if (orientation == 7) { canvas.width = image.height; canvas.height = image.width; - ctx.translate(canvas.width, canvas.height / canvas.width); + ctx.translate(canvas.width, 0); ctx.rotate(Math.PI / 2); x = -canvas.height; ctx.scale(-1, 1); } else if (orientation == 8) { canvas.width = image.height; canvas.height = image.width; - ctx.translate(canvas.width, canvas.height / canvas.width); + ctx.translate(canvas.width, 0); ctx.rotate(Math.PI / 2); x = -canvas.height; y = -canvas.width;