Skip to content

Commit

Permalink
Release 1.5.2
Browse files Browse the repository at this point in the history
  • Loading branch information
szimek committed Nov 7, 2015
1 parent 2033858 commit 3df6aa9
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 52 deletions.
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ It works in all modern desktop and mobile browsers and doesn't depend on any ext
## Installation
You can install the latest release using [Bower](http://bower.io/) - `bower install signature_pad`.

You can also download the latest release from GitHub [releases page](https://github.com/szimek/signature_pad/releases) or go to the latest release tag (e.g. [v1.5.1](https://github.com/szimek/signature_pad/tree/v1.5.1)) and download `signature_pad.js` or `signature_pad.min.js` files directly.
You can also download the latest release from GitHub [releases page](https://github.com/szimek/signature_pad/releases) or go to the latest release tag (e.g. [v1.5.2](https://github.com/szimek/signature_pad/tree/v1.5.2)) and download `signature_pad.js` or `signature_pad.min.js` files directly.

The master branch can contain undocumented or backward compatiblity breaking changes.
The master branch can contain undocumented or backward compatibility breaking changes.

## Usage
### API
Expand Down Expand Up @@ -114,6 +114,10 @@ file_put_contents( "signature.png",$decoded_image);
```

## Changelog
### 1.5.2
* Prevent loading an empty string in `fromDataURL`. (#108) [Remo](https://github.com/Remo)
* Reject points generated by resting hand (better handling of multi touch). (#48 and #57) [jurreantonisse](https://github.com/jurreantonisse)

### 1.5.1
* Prevent duplicate events on tap in iOS Safari. [PerfectPixel](https://github.com/PerfectPixel)

Expand Down
45 changes: 5 additions & 40 deletions example/js/signature_pad.js
Original file line number Diff line number Diff line change
@@ -1,36 +1,3 @@
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module unless amdModuleId is set
define([], function () {
return (root['SignaturePad'] = factory());
});
} else if (typeof exports === 'object') {
// Node. Does not work with strict CommonJS, but
// only CommonJS-like environments that support module.exports,
// like Node.
module.exports = factory();
} else {
root['SignaturePad'] = factory();
}
}(this, function () {

/*!
* Signature Pad v1.5.1
* https://github.com/szimek/signature_pad
*
* Copyright 2015 Szymon Nowak
* Released under the MIT license
*
* The main idea and some parts of the code (e.g. drawing variable width Bézier curve) are taken from:
* http://corner.squareup.com/2012/07/smoother-signatures.html
*
* Implementation of interpolation using cubic Bézier curves is taken from:
* http://benknowscode.wordpress.com/2012/09/14/path-interpolation-using-cubic-bezier-and-control-point-estimation-in-javascript
*
* Algorithm for approximated length of a Bézier curve is taken from:
* http://www.lemoda.net/maths/bezier-length/index.html
*
*/
var SignaturePad = (function (document) {
"use strict";

Expand Down Expand Up @@ -76,15 +43,17 @@ var SignaturePad = (function (document) {
};

this._handleTouchStart = function (event) {
var touch = event.changedTouches[0];
self._strokeBegin(touch);
if (event.targetTouches.length == 1) {
var touch = event.changedTouches[0];
self._strokeBegin(touch);
}
};

this._handleTouchMove = function (event) {
// Prevent scrolling.
event.preventDefault();

var touch = event.changedTouches[0];
var touch = event.targetTouches[0];
self._strokeUpdate(touch);
};

Expand Down Expand Up @@ -380,7 +349,3 @@ var SignaturePad = (function (document) {

return SignaturePad;
})(document);

return SignaturePad;

}));
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "signature_pad",
"description": "Library for drawing smooth signatures.",
"version": "1.5.1",
"version": "1.5.2",
"homepage": "https://github.com/szimek/signature_pad",
"author": {
"name": "Szymon Nowak",
Expand Down
13 changes: 6 additions & 7 deletions signature_pad.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
}(this, function () {

/*!
* Signature Pad v1.5.1
* Signature Pad v1.5.2
* https://github.com/szimek/signature_pad
*
* Copyright 2015 Szymon Nowak
Expand Down Expand Up @@ -76,15 +76,17 @@ var SignaturePad = (function (document) {
};

this._handleTouchStart = function (event) {
var touch = event.changedTouches[0];
self._strokeBegin(touch);
if (event.targetTouches.length == 1) {
var touch = event.changedTouches[0];
self._strokeBegin(touch);
}
};

this._handleTouchMove = function (event) {
// Prevent scrolling.
event.preventDefault();

var touch = event.changedTouches[0];
var touch = event.targetTouches[0];
self._strokeUpdate(touch);
};

Expand Down Expand Up @@ -116,9 +118,6 @@ var SignaturePad = (function (document) {
};

SignaturePad.prototype.fromDataURL = function (dataUrl) {
if (!dataUrl) {
return;
}
var self = this,
image = new Image(),
ratio = window.devicePixelRatio || 1,
Expand Down
4 changes: 2 additions & 2 deletions signature_pad.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 3df6aa9

Please sign in to comment.