vue-pdf-eurlanda
Advanced tools
Comparing version 3.3.18 to 3.3.19
@@ -31,3 +31,3 @@ { | ||
"scripts": {}, | ||
"version": "3.3.18" | ||
"version": "3.3.19" | ||
} |
@@ -67,9 +67,15 @@ import resizeSensor from 'vue-resize-sensor' | ||
resize: function(size) { | ||
var width = document.getElementById(this.container).offsetWidth; | ||
var height = document.getElementById(this.container).offsetHeight; | ||
// check if the element is attached to the dom tree || resizeSensor being destroyed | ||
if ( this.$el.parentNode === null || (size.width === 0 && size.height === 0) ) | ||
return; | ||
return; | ||
// on IE10- canvas height must be set | ||
this.pdf.setCanvasHeight(size.width * (this.pdf.getCanvas().height / this.pdf.getCanvas().width) + 'px'); | ||
var calHeight = width * (this.pdf.getCanvas().height / this.pdf.getCanvas().width); | ||
if(calHeight > height){ | ||
calHeight = height; | ||
} | ||
this.pdf.setCanvasHeight(calHeight + 'px'); | ||
// update the page when the resolution is too poor | ||
@@ -76,0 +82,0 @@ var resolutionScale = this.pdf.getResolutionScale(); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
28308
533