angular2-signaturepad
Advanced tools
Comparing version 1.0.3 to 1.0.4
@@ -9,2 +9,3 @@ import { ElementRef } from '@angular/core'; | ||
ngAfterContentInit(): void; | ||
resizeCanvas(): void; | ||
toDataURL(): string; | ||
@@ -11,0 +12,0 @@ fromDataURL(dataURL: string): void; |
11
index.js
@@ -32,2 +32,13 @@ 'use strict'; | ||
}; | ||
SignaturePad.prototype.resizeCanvas = function () { | ||
// When zoomed out to less than 100%, for some very strange reason, | ||
// some browsers report devicePixelRatio as less than 1 | ||
// and only part of the canvas is cleared then. | ||
var ratio = Math.max(window.devicePixelRatio || 1, 1); | ||
var canvas = this.signaturePad._canvas; | ||
canvas.width = canvas.offsetWidth * ratio; | ||
canvas.height = canvas.offsetHeight * ratio; | ||
canvas.getContext("2d").scale(ratio, ratio); | ||
this.signaturePad.clear(); // otherwise isEmpty() might return incorrect value | ||
}; | ||
// Returns signature image as data URL (see https://mdn.io/todataurl for the list of possible paramters) | ||
@@ -34,0 +45,0 @@ SignaturePad.prototype.toDataURL = function () { |
{ | ||
"name": "angular2-signaturepad", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"description": "Angular2 Component wrapper for szimek / signature_pad", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -32,3 +32,3 @@ # angular2-signaturepad | ||
'canvasWidth': 500, | ||
'canvasHeight' | ||
'canvasHeight': 300 | ||
}; | ||
@@ -35,0 +35,0 @@ |
@@ -13,3 +13,3 @@ { | ||
"index.ts", | ||
"typings/browser.d.ts" | ||
"typings/index.d.ts" | ||
], | ||
@@ -16,0 +16,0 @@ "exclude": [ |
{ | ||
"ambientDependencies": { | ||
"es6-shim": "registry:dt/es6-shim#0.31.2+20160317120654" | ||
"globalDependencies": { | ||
"es6-shim": "registry:dt/es6-shim#0.31.2+20160602141504" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
38850
13
841