fix saving canvas negative images
Signed-off-by: Victor Seiji Hariki <victorseijih@gmail.com>
This commit is contained in:
parent
fc7302f8fa
commit
8a0b9d2e8d
1 changed files with 3 additions and 2 deletions
|
@ -364,8 +364,8 @@ function downloadCanvas(options = {}) {
|
|||
defaultOpt(options, {
|
||||
cropToContent: true,
|
||||
canvas: uil.getVisible({
|
||||
x: 0,
|
||||
y: 0,
|
||||
x: -imageCollection.origin.x,
|
||||
y: -imageCollection.origin.y,
|
||||
w: imageCollection.size.w,
|
||||
h: imageCollection.size.h,
|
||||
}),
|
||||
|
@ -384,6 +384,7 @@ function downloadCanvas(options = {}) {
|
|||
var croppedCanvas = options.cropToContent
|
||||
? cropCanvas(options.canvas).canvas
|
||||
: options.canvas;
|
||||
|
||||
if (croppedCanvas != null) {
|
||||
croppedCanvas.toBlob((blob) => {
|
||||
link.href = URL.createObjectURL(blob);
|
||||
|
|
Loading…
Reference in a new issue