{
if (value == null)
{
- throw new ArgumentNullException("value");
+ throw new ArgumentNullException(nameof(value));
}
int status = SafeNativeMethods.Gdip.GdipSetTextureTransform(new HandleRef(this, NativeBrush), new HandleRef(value, value.nativeMatrix));
throw new ArgumentNullException(nameof(matrix));
}
+ // Multiplying the transform by a disposed matrix is a nop in GDI+, but throws
+ // with the libgdiplus backend. Simulate a nop for compatability with GDI+.
+ if (matrix.nativeMatrix == IntPtr.Zero)
+ {
+ return;
+ }
+
int status = SafeNativeMethods.Gdip.GdipMultiplyTextureTransform(new HandleRef(this, NativeBrush),
new HandleRef(matrix, matrix.nativeMatrix),
order);
AssertExtensions.Throws<ArgumentException>(null, () => new TextureBrush(image, WrapMode.Tile, Rectangle.Empty));
}
- [ActiveIssue(20884, TestPlatforms.AnyUnix)]
[ConditionalTheory(Helpers.GdiplusIsAvailable)]
[InlineData(WrapMode.Tile - 1)]
[InlineData(WrapMode.Clamp + 1)]
}
}
- [ActiveIssue(20884, TestPlatforms.AnyUnix)]
[ConditionalFact(Helpers.GdiplusIsAvailable)]
public void MultiplyTransform_DisposedMatrix_Nop()
{
}
}
- [ActiveIssue(20884, TestPlatforms.AnyUnix)]
[ConditionalFact(Helpers.GdiplusIsAvailable)]
public void Transform_SetNull_ThrowsArgumentNullException()
{
}
}
- [ActiveIssue(20884, TestPlatforms.AnyUnix)]
[ConditionalTheory(Helpers.GdiplusIsAvailable)]
[InlineData(WrapMode.Tile - 1)]
[InlineData(WrapMode.Clamp + 1)]