@@ -73,14 +73,13 @@ export function apply2dTransforms({
73
73
}
74
74
}
75
75
76
- const Transform2d = ( {
77
- children,
76
+ export function use2dTransformations ( {
78
77
parentMatrixWorld,
79
78
translate,
80
79
scale,
81
80
rotate,
82
81
multiplicationOrder = 'POST' ,
83
- } : Transform2dProps ) => {
82
+ } : Omit < Transform2dProps , 'children' > ) {
84
83
const safeParentMatrixWorld = useFactoryRef < mat2d > (
85
84
( ) => parentMatrixWorld || mat2d . create ( ) ,
86
85
) ;
@@ -101,6 +100,28 @@ const Transform2d = ({
101
100
rotate,
102
101
} ) ;
103
102
103
+ return {
104
+ matrix,
105
+ matrixWorld,
106
+ } ;
107
+ }
108
+
109
+ const Transform2d = ( {
110
+ children,
111
+ parentMatrixWorld,
112
+ translate,
113
+ scale,
114
+ rotate,
115
+ multiplicationOrder = 'POST' ,
116
+ } : Transform2dProps ) => {
117
+ const { matrixWorld } = use2dTransformations ( {
118
+ parentMatrixWorld,
119
+ translate,
120
+ scale,
121
+ rotate,
122
+ multiplicationOrder,
123
+ } ) ;
124
+
104
125
const render = useRender < mat2d > ( {
105
126
cssMatrixPrefix : 'matrix' ,
106
127
matrixWorld,
0 commit comments