We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f712471 commit 9816ea8Copy full SHA for 9816ea8
4 files changed
README.md
@@ -53,6 +53,10 @@ To build the files of the `dist/` folder, just use the following command:
53
54
* **[NEXT]** (changes on `master`, but not released yet):
55
56
+ * Nothing yet :)
57
+
58
+* **v1.0.4:**
59
60
* fix: Use `Math.atan2()` to allow rotating the image to more than 90° (@zhiqisuns, #14)
61
62
* **v1.0.3:**
dist/perspective.js
@@ -120,7 +120,7 @@ var html5jp = window.html5jp || {};
120
var sy = d0y + (d3y-d0y) * r;
121
var ex = d1x + (d2x-d1x) * r;
122
var ey = d1y + (d2y-d1y) * r;
123
- var ag = Math.atan( (ey-sy) / (ex-sx) );
+ var ag = Math.atan2(ey - sy, ex - sx);
124
var sc = Math.sqrt( Math.pow(ex-sx, 2) + Math.pow(ey-sy, 2) ) / ow;
125
ctxl.setTransform(1, 0, 0, 1, 0, -y);
126
ctxl.drawImage(ctxo.canvas, 0, 0);
@@ -142,7 +142,7 @@ var html5jp = window.html5jp || {};
142
var sy = d0y + (d1y-d0y) * r;
143
var ex = d3x + (d2x-d3x) * r;
144
var ey = d3y + (d2y-d3y) * r;
145
- var ag = Math.atan( (sx-ex) / (ey-sy) );
+ var ag = Math.atan2(sx - ex, ey - sy);
146
var sc = Math.sqrt( Math.pow(ex-sx, 2) + Math.pow(ey-sy, 2) ) / oh;
147
ctxl.setTransform(1, 0, 0, 1, -x, 0);
148
dist/perspective.min.js
package.json
@@ -1,6 +1,6 @@
1
{
2
"name": "perspectivejs",
3
- "version": "1.0.3",
+ "version": "1.0.4",
4
"description": "Transforms the perspective of an image and draw it on a canvas",
5
"main": "src/perspective.js",
6
"scripts": {
0 commit comments