Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,13 @@ public Issue16767_Resize(TestDevice testDevice) : base(testDevice)
public override string Issue => "Resize function in W2DImage class";
protected override bool ResetAfterEachTest => true;

#if TEST_FAILS_ON_IOS //Issue Link - https://github.com/dotnet/maui/issues/34755
[Test]
[Category(UITestCategories.GraphicsView)]
public void ImagePaintWithResizeModeFit()
{
App.WaitForElement("ResizeModeFit");
VerifyScreenshot();
}
#endif

[Test]
[Category(UITestCategories.GraphicsView)]
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions src/Graphics/src/Graphics/Platforms/MaciOS/PlatformCanvas.cs
Original file line number Diff line number Diff line change
Expand Up @@ -708,6 +708,10 @@ public override void FillRectangle(float x, float y, float width, float height)
private void FillWithPattern(nfloat x, nfloat y, Action drawingAction)
{
_context.SaveState();

// Reset the pattern phase so the pattern starts at the correct origin.
_context.SetPatternPhase(CGSize.Empty);

var colorspace = CGColorSpace.CreatePattern(null);
_context.SetFillColorSpace(colorspace);

Expand Down Expand Up @@ -741,6 +745,12 @@ private void FillWithPattern(nfloat x, nfloat y, Action drawingAction)
private void FillWithImage(nfloat x, nfloat y, Action drawingAction)
{
_context.SaveState();

// The view's PatternPhase is pre-set by PlatformGraphicsView,
// which shifts the image tile and causes it to split across the fill rect.
// Reset it here to the fill rect origin so the image starts at the right place.
_context.SetPatternPhase(CGSize.Empty);

var baseColorspace = _getColorspace?.Invoke();
var colorspace = CGColorSpace.CreatePattern(baseColorspace);
_context.SetFillColorSpace(colorspace);
Expand Down
Loading