@@ -169,18 +169,32 @@ private static void SetProjectionMatrix(TFrameworkElement view, JArray transform
169
169
170
170
private static void ApplyProjection ( TFrameworkElement view , Matrix3D projectionMatrix )
171
171
{
172
- if ( ! IsSimpleTranslationOnly ( projectionMatrix ) )
172
+ if ( ! projectionMatrix . IsAffine )
173
173
{
174
- throw new InvalidOperationException ( "ReactNative.Net46 does not support 3D transformations" ) ;
174
+ throw new NotImplementedException ( "ReactNative.Net46 does not support non-affine transformations" ) ;
175
175
}
176
176
177
- ResetProjectionMatrix ( view ) ;
178
- var transform = new MatrixTransform ( ) ;
179
- var matrix = transform . Matrix ;
180
- matrix . OffsetX = projectionMatrix . OffsetX ;
181
- matrix . OffsetY = projectionMatrix . OffsetY ;
182
- transform . Matrix = matrix ;
183
- view . RenderTransform = transform ;
177
+ if ( IsSimpleTranslationOnly ( projectionMatrix ) )
178
+ {
179
+ ResetProjectionMatrix ( view ) ;
180
+ var transform = new MatrixTransform ( ) ;
181
+ var matrix = transform . Matrix ;
182
+ matrix . OffsetX = projectionMatrix . OffsetX ;
183
+ matrix . OffsetY = projectionMatrix . OffsetY ;
184
+ transform . Matrix = matrix ;
185
+ view . RenderTransform = transform ;
186
+ }
187
+ else
188
+ {
189
+ var transform = new MatrixTransform ( projectionMatrix . M11 ,
190
+ projectionMatrix . M12 ,
191
+ projectionMatrix . M21 ,
192
+ projectionMatrix . M22 ,
193
+ projectionMatrix . OffsetX ,
194
+ projectionMatrix . OffsetY ) ;
195
+
196
+ view . RenderTransform = transform ;
197
+ }
184
198
}
185
199
186
200
private static bool IsSimpleTranslationOnly ( Matrix3D matrix )
0 commit comments