src/matrix_math.js
//   - The order in which you combine the transformations is VERY important
The order in which you combine the transformations is VERY important
The order in which you combine the transformations is VERY important
function rebuildTransformationMatrix(shape){
  var tempMatrix = shape.M;
  shape.rotAroundCenter = true;
  var tranMatrix = makeTranslationMatrix(shape.tx,shape.ty);
  var scaleMatrix = makeScaleMatrix(shape.sx,shape.sy);
  var rotMatrix = makeRotationMatrix(shape.rotAngle);
  var newRTM = multiplyMatrices(shape.M,tranMatrix);
  newRTM = multiplyMatrices(newRTM,scaleMatrix);
  newRTM = multiplyMatrices(newRTM,rotMatrix);
  shape.M = newRTM;
}
function rebuildTransformationMatrix ( shape ) { var tempMatrix = shape . M ; shape . rotAroundCenter = true ; var tranMatrix = makeTranslationMatrix ( shape . tx , shape . ty ) ; var scaleMatrix = makeScaleMatrix ( shape . sx , shape . sy ) ; var rotMatrix = makeRotationMatrix ( shape . rotAngle ) ; var newRTM = multiplyMatrices ( shape . M , tranMatrix ) ; newRTM = multiplyMatrices ( newRTM , scaleMatrix ) ; newRTM = multiplyMatrices ( newRTM , rotMatrix ) ; shape . M = newRTM ; }
The order in which you combine the transformations is VERY important
The order in which you combine the transformations is VERY important