Skip to content

Commit

Permalink
fix: error when disable one of rotatable and scalable options
Browse files Browse the repository at this point in the history
  • Loading branch information
fengyuanchen committed Oct 19, 2017
1 parent 4da21d1 commit bdbc456
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/js/render.js
Original file line number Diff line number Diff line change
Expand Up @@ -214,9 +214,9 @@ export default {

if (transformed) {
const { width: naturalWidth, height: naturalHeight } = getRotatedSizes({
width: imageData.naturalWidth * Math.abs(imageData.scaleX),
height: imageData.naturalHeight * Math.abs(imageData.scaleY),
degree: imageData.rotate,
width: imageData.naturalWidth * Math.abs(imageData.scaleX || 1),
height: imageData.naturalHeight * Math.abs(imageData.scaleY || 1),
degree: imageData.rotate || 0,
});
const width = canvasData.width * (naturalWidth / canvasData.naturalWidth);
const height = canvasData.height * (naturalHeight / canvasData.naturalHeight);
Expand Down
6 changes: 3 additions & 3 deletions src/js/utilities.js
Original file line number Diff line number Diff line change
Expand Up @@ -709,9 +709,9 @@ export function getSourceCanvas(
{
naturalWidth: imageNaturalWidth,
naturalHeight: imageNaturalHeight,
rotate,
scaleX,
scaleY,
rotate = 0,
scaleX = 1,
scaleY = 1,
},
{
aspectRatio,
Expand Down

0 comments on commit bdbc456

Please sign in to comment.