KEMBAR78
Revert "Fix up relevant CA1416 warnings - Set 3 (#26751)" by PureWeen · Pull Request #30421 · dotnet/maui · GitHub
Skip to content

Conversation

@PureWeen
Copy link
Member

@PureWeen PureWeen commented Jul 3, 2025

Note

Are you waiting for the changes in this PR to be merged?
It would be very helpful if you could test the resulting artifacts from this PR and let us know in a comment if this change resolves your issue. Thank you!

Description of Change

Issues Fixed

Fixes #30426
Fixes #30350

@Copilot Copilot AI review requested due to automatic review settings July 3, 2025 15:48
@PureWeen PureWeen requested a review from a team as a code owner July 3, 2025 15:48
@PureWeen
Copy link
Member Author

PureWeen commented Jul 3, 2025

/backport to release/9.0.1xx-sr8

@github-actions
Copy link
Contributor

github-actions bot commented Jul 3, 2025

Started backporting to release/9.0.1xx-sr8: https://github.com/dotnet/maui/actions/runs/16054981429

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR reverts the previous CA1416 fix set, restoring the old image-scaling method and removing the FontImage UI tests.

  • Reverted ScaleImage implementation from UIGraphicsImageRenderer back to UIGraphics.BeginImageContext style
  • Removed FontImageUITest from both Shared.Tests and HostApp projects

Reviewed Changes

Copilot reviewed 3 out of 7 changed files in this pull request and generated 1 comment.

File Description
src/Graphics/src/Graphics/Platforms/iOS/UIImageExtensions.cs Restored legacy BeginImageContext scaling method
src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/FontImageUITest.cs Deleted shared UI test for FontImage
src/Controls/tests/TestCases.HostApp/Issues/FontImageUITest.cs Deleted HostApp UI page for FontImage test
Comments suppressed due to low confidence (2)

target.Dispose();
}
});
UIGraphics.BeginImageContext(size);
Copy link

Copilot AI Jul 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using UIGraphics.BeginImageContext without specifying options may produce images at the wrong scale (non-retina) and is less efficient. Consider using UIGraphicsBeginImageContextWithOptions(size, opaque: false, scale: UIScreen.MainScreen.Scale) or reinstating UIGraphicsImageRenderer to ensure correct scaling and performance.

Suggested change
UIGraphics.BeginImageContext(size);
UIGraphics.BeginImageContextWithOptions(size, false, UIScreen.MainScreen.Scale);

Copilot uses AI. Check for mistakes.

@github-project-automation github-project-automation bot moved this from Ready To Review to Approved in MAUI SDK Ongoing Jul 4, 2025
@PureWeen
Copy link
Member Author

PureWeen commented Jul 7, 2025

/rebase

This reverts commit 636bd12.

# Conflicts:
#	src/Controls/tests/TestCases.Mac.Tests/snapshots/mac/VerifyFontImage.png
#	src/Core/src/Hosting/LifecycleEvents/AppHostBuilderExtensions.iOS.cs
#	src/Graphics/src/Graphics/Platforms/iOS/UIImageExtensions.cs
@PureWeen
Copy link
Member Author

PureWeen commented Jul 7, 2025

  • failing tests unrelated

@PureWeen PureWeen merged commit 0529472 into main Jul 7, 2025
124 of 129 checks passed
@PureWeen PureWeen deleted the revert_26751 branch July 7, 2025 21:15
@github-project-automation github-project-automation bot moved this from Approved to Done in MAUI SDK Ongoing Jul 7, 2025
@github-actions github-actions bot locked and limited conversation to collaborators Aug 7, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

Status: Done

2 participants