MCPcopy
hub / github.com/fabricjs/fabric.js / calcOwnMatrix

Method calcOwnMatrix

src/shapes/Object/ObjectGeometry.ts:501–525  ·  view source on GitHub ↗

* calculate transform matrix that represents the current transformations from the * object's properties, this matrix does not include the group transformation * @return {TMat2D} transform matrix for the object

()

Source from the content-addressed store, hash-verified

499 * @return {TMat2D} transform matrix for the object
500 */
501 calcOwnMatrix(): TMat2D {
502 const key = this.transformMatrixKey(true),
503 cache = this.ownMatrixCache;
504 if (cache && cache.key === key) {
505 return cache.value;
506 }
507 const center = this.getRelativeCenterPoint(),
508 options = {
509 angle: this.angle,
510 translateX: center.x,
511 translateY: center.y,
512 scaleX: this.scaleX,
513 scaleY: this.scaleY,
514 skewX: this.skewX,
515 skewY: this.skewY,
516 flipX: this.flipX,
517 flipY: this.flipY,
518 },
519 value = composeMatrix(options);
520 this.ownMatrixCache = {
521 key,
522 value,
523 };
524 return value;
525 }
526
527 /**
528 * Calculate object dimensions from its properties

Callers 14

calcTransformMatrixMethod · 0.95
object_geometry.jsFile · 0.80
getSvgTransformMethod · 0.80
polyActionHandlerFunction · 0.80
factoryPolyActionHandlerFunction · 0.80
addTransformToObjectFunction · 0.80
sendObjectToPlaneFunction · 0.80
getLayoutResultMethod · 0.80
calcLayoutResultMethod · 0.80

Calls 3

transformMatrixKeyMethod · 0.95
composeMatrixFunction · 0.90

Tested by

no test coverage detected