2024-05-06 01:06:14 -05:00
|
|
|
import { ShapeGeomAttributes } from '@ui/lib/types/shapes/shape';
|
2024-04-15 06:58:51 -05:00
|
|
|
|
2024-05-29 03:30:56 -05:00
|
|
|
export const transformDimension = (
|
|
|
|
node: DimensionAndPositionMixin
|
|
|
|
): Pick<ShapeGeomAttributes, 'width' | 'height'> => {
|
|
|
|
return {
|
|
|
|
width: node.width,
|
|
|
|
height: node.height
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2024-04-15 06:58:51 -05:00
|
|
|
export const transformDimensionAndPosition = (
|
2024-06-14 09:28:01 -05:00
|
|
|
node: DimensionAndPositionMixin
|
2024-04-15 06:58:51 -05:00
|
|
|
): ShapeGeomAttributes => {
|
|
|
|
return {
|
2024-06-14 09:28:01 -05:00
|
|
|
x: node.absoluteTransform[0][2],
|
|
|
|
y: node.absoluteTransform[1][2],
|
2024-04-15 06:58:51 -05:00
|
|
|
width: node.width,
|
|
|
|
height: node.height
|
|
|
|
};
|
|
|
|
};
|