Skip to content

Commit 9816ea8

Browse files
committed
v1.0.4
1 parent f712471 commit 9816ea8

4 files changed

Lines changed: 8 additions & 4 deletions

File tree

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,10 @@ To build the files of the `dist/` folder, just use the following command:
5353

5454
* **[NEXT]** (changes on `master`, but not released yet):
5555

56+
* Nothing yet :)
57+
58+
* **v1.0.4:**
59+
5660
* fix: Use `Math.atan2()` to allow rotating the image to more than 90° (@zhiqisuns, #14)
5761

5862
* **v1.0.3:**

dist/perspective.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ var html5jp = window.html5jp || {};
120120
var sy = d0y + (d3y-d0y) * r;
121121
var ex = d1x + (d2x-d1x) * r;
122122
var ey = d1y + (d2y-d1y) * r;
123-
var ag = Math.atan( (ey-sy) / (ex-sx) );
123+
var ag = Math.atan2(ey - sy, ex - sx);
124124
var sc = Math.sqrt( Math.pow(ex-sx, 2) + Math.pow(ey-sy, 2) ) / ow;
125125
ctxl.setTransform(1, 0, 0, 1, 0, -y);
126126
ctxl.drawImage(ctxo.canvas, 0, 0);
@@ -142,7 +142,7 @@ var html5jp = window.html5jp || {};
142142
var sy = d0y + (d1y-d0y) * r;
143143
var ex = d3x + (d2x-d3x) * r;
144144
var ey = d3y + (d2y-d3y) * r;
145-
var ag = Math.atan( (sx-ex) / (ey-sy) );
145+
var ag = Math.atan2(sx - ex, ey - sy);
146146
var sc = Math.sqrt( Math.pow(ex-sx, 2) + Math.pow(ey-sy, 2) ) / oh;
147147
ctxl.setTransform(1, 0, 0, 1, -x, 0);
148148
ctxl.drawImage(ctxo.canvas, 0, 0);

dist/perspective.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "perspectivejs",
3-
"version": "1.0.3",
3+
"version": "1.0.4",
44
"description": "Transforms the perspective of an image and draw it on a canvas",
55
"main": "src/perspective.js",
66
"scripts": {

0 commit comments

Comments
 (0)