Skip to content

Commit 6481a55

Browse files
committed
[Direct2D1] Fix issue for Matrix effect parameter
1 parent 4f5fb26 commit 6481a55

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

Source/SharpDX.Direct2D1/PropertyBinding.cs

+7-7
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ public static PropertyBinding Get(Type customEffectType, PropertyInfo propertyIn
8181
binding.nativeGetSet = new NativeGetSetValue<int>(customEffectType, propertyInfo);
8282
effectPropType = PropertyType.Bool;
8383
}
84-
else if (propTypeName.Contains("Vector2"))
84+
else if (propTypeName.Contains("Vector2")) // Use string property name to allow external types (Mathematics, System Numerics...etc.)
8585
{
8686
binding.nativeGetSet = new NativeGetSetValue<RawVector2>(customEffectType, propertyInfo);
8787
effectPropType = PropertyType.Vector2;
@@ -111,11 +111,6 @@ public static PropertyBinding Get(Type customEffectType, PropertyInfo propertyIn
111111
binding.nativeGetSet = new NativeGetSetValue<RawColor4>(customEffectType, propertyInfo);
112112
effectPropType = PropertyType.Vector4;
113113
}
114-
else if(propTypeName.Contains("Matrix"))
115-
{
116-
binding.nativeGetSet = new NativeGetSetValue<RawMatrix>(customEffectType, propertyInfo);
117-
effectPropType = PropertyType.Matrix4x4;
118-
}
119114
else if(propTypeName.Contains("Matrix3x2"))
120115
{
121116
binding.nativeGetSet = new NativeGetSetValue<RawMatrix3x2>(customEffectType, propertyInfo);
@@ -126,7 +121,12 @@ public static PropertyBinding Get(Type customEffectType, PropertyInfo propertyIn
126121
binding.nativeGetSet = new NativeGetSetValue<RawMatrix5x4>(customEffectType, propertyInfo);
127122
effectPropType = PropertyType.Matrix5x4;
128123
}
129-
else if(Utilities.IsEnum(propType))
124+
else if (propTypeName.Contains("Matrix"))
125+
{
126+
binding.nativeGetSet = new NativeGetSetValue<RawMatrix>(customEffectType, propertyInfo);
127+
effectPropType = PropertyType.Matrix4x4;
128+
}
129+
else if (Utilities.IsEnum(propType))
130130
{
131131
// For enum, we are using int as a transient value
132132
binding.nativeGetSet = new NativeGetSetValue<int>(customEffectType, propertyInfo);

0 commit comments

Comments
 (0)