Skip to content

[iOS, Mac] Fix GraphicsView drawable shadows ignoring FlowDirection - #39544

Merged
kubaflo merged 2 commits into
dotnet:net11.0from
SyedAbdulAzeemSF4852:fix-39511
Oct 26, 2026
Merged

kubaflo merged 2 commits into
dotnet:net11.0from
SyedAbdulAzeemSF4852:fix-39511

Conversation

@SyedAbdulAzeemSF4852

Copy link
Copy Markdown
Contributor

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!

Issue Details

  • The Shadow property on a GraphicsView does not work as expected when changing the FlowDirection property on iOS and macOS. The shadow behavior appears to change depending on the flow direction on Windows and Android, but the same behavior is not observed on iOS and macOS.

Root Cause

  • On iOS and Mac Catalyst, GraphicsView mirrors its drawing context for right-to-left layout, but Core Graphics does not apply that transform to shadow offsets, causing drawable shadows to retain their left-to-right horizontal direction.

Description of Change

  • Added a ShouldMirrorShadowOffsetX property to PlatformCanvas, and updated the SetShadow method to mirror the X offset for shadows when rendering in RTL layouts. This ensures that shadow direction matches the flow direction, fixing inconsistencies in visual appearance.
  • Updated DirectRenderer on iOS to set ShouldMirrorShadowOffsetX based on the effective layout direction before drawing, and reset it after drawing is complete.

Issues Fixed

Fixes #39511

Validated the behaviour in the following platforms

  • Windows
  • Android
  • iOS
  • Mac

Output

Platform Before After
iOS
iOS_Before.mov
iOS_Afer.mov
Mac
Mac_Before.mov
Mac_After.mov

@github-actions

Copy link
Copy Markdown
Contributor

🚀 Dogfood this PR with:

⚠️ WARNING: Do not do this without first carefully reviewing the code of this PR to satisfy yourself it is safe.

curl -fsSL https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.sh | bash -s -- 39544

Or

  • Run remotely in PowerShell:
iex "& { $(irm https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.ps1) } 39544"

@azure-pipelines

This comment has been minimized.

@dotnet-policy-service dotnet-policy-service Bot added the community ✨ Community Contribution label Oct 22, 2026
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Hey there @@SyedAbdulAzeemSF4852! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed.

@dotnet-policy-service dotnet-policy-service Bot added the partner/syncfusion Issues / PR's with Syncfusion collaboration label Oct 22, 2026
@github-actions github-actions Bot added area-drawing Shapes, Borders, Shadows, Graphics, BoxView, custom drawing platform/ios platform/macos macOS / Mac Catalyst labels Oct 22, 2026
@github-actions github-actions Bot added the s/agent-review-in-progress AI review is currently running for this PR label Oct 22, 2026
@kubaflo

This comment has been minimized.

@azure-pipelines

This comment has been minimized.

@kubaflo

This comment has been minimized.

@github-actions

This comment has been minimized.

@SyedAbdulAzeemSF4852 SyedAbdulAzeemSF4852 changed the title [WIP][iOS, Mac] Fix GraphicsView drawable shadows ignoring FlowDirection [iOS, Mac] Fix GraphicsView drawable shadows ignoring FlowDirection Oct 23, 2026
@kubaflo

This comment has been minimized.

@github-actions

This comment has been minimized.

@sheiksyedm
sheiksyedm marked this pull request as ready for review October 26, 2026 11:01
Copilot AI balanced review requested due to automatic review settings October 26, 2026 11:01

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

Native rendering behavior still needs confirmation from passing iOS and Mac Catalyst device tests and human review.

No open issues 🎉

What changed in this PR

Fixes #39511 by making GraphicsView drawable shadows follow right-to-left layout on iOS and Mac Catalyst, aligning their horizontal direction with the mirrored drawing.

Changes:

  • Adds an internal canvas flag to reverse horizontal shadow offsets.
  • Sets the flag from the effective layout direction and clears it after drawing.
  • Adds device tests covering direction changes and positive and negative shadow offsets.
File Description
src/​Graphics/​src/​Graphics/​Platforms/​MaciOS/​PlatformCanvas.cs Mirrors horizontal shadow offsets when enabled.
src/​Graphics/​src/​Graphics/​Platforms/​iOS/​DirectRenderer.cs Applies and resets layout-dependent shadow mirroring.
src/​Core/​tests/​DeviceTests/​Handlers/​GraphicsView/​GraphicsViewHandlerTests.iOS.cs Tests shadow placement across layout-direction changes.

Review effort: Balanced

@kubaflo

This comment has been minimized.

@github-actions

Copy link
Copy Markdown
Contributor

Tests Failure Analysis

@SyedAbdulAzeemSF4852 — test-failure analysis for commit 977c2b4.

Scope CI failures Commit 977c2b4


🧪 CI Analysis — click to expand
📊 maui-pr

🧪 maui-pr-devicetests

No failures found.


🧪 maui-pr-uitests

All five target samples have coverage gaps; missing matches cannot clear these MacCatalyst failures.


🧭 Follow-up — actions and refresh

Next action: Inspect Android install diagnostics and MacCatalyst screenshots/Appium traces; compare identical setup on main.

Maintainers: comment /review tests to refresh this report.

@kubaflo
kubaflo changed the base branch from main to net11.0 October 26, 2026 16:35
@kubaflo
kubaflo merged commit 029e30d into dotnet:net11.0 Oct 26, 2026
200 of 212 checks passed
@github-actions github-actions Bot added this to the .NET 11.0-rc2 milestone Oct 26, 2026

This branch was previously deployed

1 inactive deployment
copilot-pat-pool — 977c2b44 Deployed Oct 22, 2026 by SyedAbdulAzeemSF4852 via conclusion #2447
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-drawing Shapes, Borders, Shadows, Graphics, BoxView, custom drawing community ✨ Community Contribution partner/syncfusion Issues / PR's with Syncfusion collaboration platform/ios platform/macos macOS / Mac Catalyst s/agent-review-in-progress AI review is currently running for this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[iOS, macOS] GraphicsView Shadow does not respect FlowDirection changes

3 participants