Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[macOS Avatar] Fix custom border drawing when built with Xcode 15 #1921

Merged

Conversation

anandrajeswaran
Copy link
Contributor

@anandrajeswaran anandrajeswaran commented Oct 26, 2023

Platforms Impacted

  • iOS
  • macOS

Description of changes

In AvatarView's drawRect override, we're drawing relative to the dirtyRect parameter instead of drawing to our bounds. This was already technically a bug because dirtyRect since this could have been incorrect if setNeedsDisplayInRect: was used to invalidate part of the view. In practice that probably wasn't happening. But now NSView.clipsToBounds defaults to true when building with Xcode 15+ and running on macOS 14.0+ so AppKit now often gives us a dirtyRect which extends beyond the bounds of our view. That makes this much more obviously incorrect.

To fix, just draw the border relative to our bounds.

Binary change

No impact

Verification

See screenshots

Visual Verification
Before After
image
image

|

Pull request checklist

This PR has considered:

  • Light and Dark appearances
  • iOS supported versions (all major versions greater than or equal current target deployment version)
  • VoiceOver and Keyboard Accessibility
  • Internationalization and Right to Left layouts
  • Different resolutions (1x, 2x, 3x)
  • Size classes and window sizes (iPhone vs iPad, notched devices, multitasking, different window sizes, etc)
  • iPad Pointer interaction
  • SwiftUI consumption (validation or new demo scenarios needed)
  • Objective-C exposure (provide it only if needed)
Microsoft Reviewers: Open in CodeFlow

@anandrajeswaran anandrajeswaran requested a review from a team as a code owner October 26, 2023 17:57
@anandrajeswaran anandrajeswaran merged commit bcfab92 into microsoft:main Oct 26, 2023
6 checks passed
@mischreiber mischreiber mentioned this pull request Nov 17, 2023
11 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants