From 0cda6baefee91c120a5ec1cf69f05b26766c20ef Mon Sep 17 00:00:00 2001 From: Ryan Phillips Date: Wed, 2 May 2018 15:22:20 -0400 Subject: [PATCH] Fix incorrect sizing for canvas when setting the background image - Fixes the current width and height always being set to the width and height of the image, even when a width and height are specified in the options. --- djaodjin-annotate.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/djaodjin-annotate.js b/djaodjin-annotate.js index 716ca6a..1ebb2ca 100644 --- a/djaodjin-annotate.js +++ b/djaodjin-annotate.js @@ -310,8 +310,7 @@ MIT License self.img = new Image(); self.img.src = image.path; self.img.onload = function() { - if ((self.options.width && self.options.height) !== undefined || - (self.options.width && self.options.height) !== 0) { + if (!self.options.width && !self.options.height) { self.currentWidth = this.width; self.currentHeight = this.height; self.selectImageSize.width = this.width;