fix cropCanvas bounding box

Signed-off-by: Victor Seiji Hariki <victorseijih@gmail.com>
This commit is contained in:
Victor Seiji Hariki 2022-12-12 10:54:26 -03:00
parent b71731b7ca
commit 34b995998b

View file

@ -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");