From 34b995998b593aa6a12cb4fed6a5e52e294ef493 Mon Sep 17 00:00:00 2001 From: Victor Seiji Hariki Date: Mon, 12 Dec 2022 10:54:26 -0300 Subject: [PATCH] fix cropCanvas bounding box Signed-off-by: Victor Seiji Hariki --- js/lib/util.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/lib/util.js b/js/lib/util.js index 0f80380..b8aa607 100644 --- a/js/lib/util.js +++ b/js/lib/util.js @@ -232,8 +232,8 @@ function cropCanvas(sourceCanvas, options = {}) { bb.x = minx - options.border; bb.y = miny - options.border; - bb.w = maxx - minx + 2 * options.border; - bb.h = maxy - miny + 2 * options.border; + bb.w = maxx - minx + 1 + 2 * options.border; + bb.h = maxy - miny + 1 + 2 * options.border; if (maxx < 0) throw new NoContentError("Canvas has no content to crop");