Skip to content

Commit

Permalink
+ Normalize angle
Browse files Browse the repository at this point in the history
  • Loading branch information
RubaXa committed Jan 27, 2014
1 parent 626abaa commit 8990c43
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions lib/FileAPI.Image.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,9 @@
, renderImageToCanvas = api.renderImageToCanvas
;

// Normalize angle
deg = deg - Math.floor(deg/360)*360;

// For `renderImageToCanvas`
image._type = this.file.type;

Expand Down
Binary file removed tests/.DS_Store
Binary file not shown.
Binary file removed tests/files/.DS_Store
Binary file not shown.
2 changes: 1 addition & 1 deletion tests/tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ module('FileAPI');

FileAPI.html5 && test('upload FileAPI.Image', function (){
var file = FileAPI.getFiles(uploadForm['dino.png'])[0];
var image = FileAPI.Image(file).rotate(90).preview(100);
var image = FileAPI.Image(file).rotate(90+360).preview(100);
var _progressFail = false, _progress = 0;

stop();
Expand Down

0 comments on commit 8990c43

Please sign in to comment.