How to use the transformation-matrix.toCSS function in transformation-matrix

To help you get started, we’ve selected a few transformation-matrix examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github skmail / react-free-transform / src / ElementStyler.js View on Github external
scale(scaleX, scaleY)
    );
  }else{
    transformMatrix = transform(
      translate(roundTo(x + changedWidth ), roundTo(y + changedHeight )),
      rotate(angle * (Math.PI / 180)),
    );
    width = newWidth;
    height = newHeight;
  }

  return {
    element: {
      width,
      height,
      transform: toCSS(transformMatrix),
      position: "absolute",
    },
    controls: {
      width: newWidth,
      height: newHeight,
      transform: toCSS(
        transform(
          translate(roundTo(x + changedWidth), roundTo(y + changedHeight)),
          rotate(angle * (Math.PI / 180)),
        )
      ),
      position: "absolute",
    }
  }
}
github skmail / react-free-transform / src / ElementStyler.js View on Github external
);
    width = newWidth;
    height = newHeight;
  }

  return {
    element: {
      width,
      height,
      transform: toCSS(transformMatrix),
      position: "absolute",
    },
    controls: {
      width: newWidth,
      height: newHeight,
      transform: toCSS(
        transform(
          translate(roundTo(x + changedWidth), roundTo(y + changedHeight)),
          rotate(angle * (Math.PI / 180)),
        )
      ),
      position: "absolute",
    }
  }
}