Repository navigation
Conversation
<!-- Please let the below note in for people that find this PR --> > [!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](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! <!-- Open .NET 11 fix PRs against net11 for review; target main for next-major features. After approval, a maintainer manually retargets the fix PR to the active inflight branch and merges it directly there. Do not merge individual fixes into net11. Bots must not retarget or merge. Candidate integration into net11 and release/* changes are separate, explicitly coordinated release work. --> ### Target Branch | This PR is for | Initial base | | --- | --- | | New features, API changes, or .NET 12 work (including .NET 12 fixes) | `main` | | .NET 11 servicing fixes | `net11`, for review | | Older servicing, release integration, infrastructure, or documentation | The branch designated for that work | - [ ] I selected the applicable base branch using the [contribution guide](https://github.com/dotnet/maui/blob/main/.github/CONTRIBUTING.md#choose-your-pr-base-before-starting). For .NET 11 fixes, only a maintainer retargets the approved PR to the active inflight lane and merges it after CI validates that final base. Do not merge individual fixes directly into `net11`; agents must not retarget or merge. ### Description of Change <!-- Enter description of the fix in this section --> <!-- maui-release-state:production:11.0.1xx-sr2 --> Advance canonical **`eng/release-rollover.json`** from SR1 to SR2 after verified staging, reviewed normalization and next-lane preparation. Staged source: `01c74ef93c991830e310a77ec808b51b29bcac1f`. Next candidate: `candidate/11.0.1xx-sr2`. Next inflight: `inflight/11.0.1xx-sr3`. No real release branch or servicing review is required for this state update. Independently, the publication workflow opens a servicing PR against staging; after reviewing it and using Create a merge commit, a maintainer manually cuts the real release at that exact merge. Staging alone never authorizes signing. Only `currentSr` changes. `nightlyMode` remains **legacy**; SDK, package metadata, branch roles, release contents and access rules are unchanged. **Review and required CI are mandatory. Automation never updates the default branch, approves, retargets or merges this PR.** If nightlyMode is already versioned, advancing currentSr also selects the following inflight lane. Before merging, verify that exact lane has its protections, internal mirror, schedule, signed artifacts and existing feed/channel wiring deployed. The first legacy-to-versioned switch is a separate owner-reviewed state change after that deployment evidence exists; this PR does not guess or certify it. ### Issues Fixed <!-- Please make sure that there is a bug logged for the issue being fixed. The bug should describe the problem and how to reproduce it. --> N/A - staged release configuration. <!-- Verify the target branch follows the release workflow in docs/ReleaseBranchWorkflow.md. Infrastructure and documentation changes should target the branch where they apply. --> Co-authored-by: Jakub Florkowski <42434498+kubaflo@users.noreply.github.com>
Route stroke-aware path requests through IShape so custom Shape implementations receive the supplied bounds. Preserve and restore the stroke context for built-in geometry. Add regression tests for custom shape dispatch, Border stroke shapes, and stroke context restoration. Fixes dotnet#40129
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.sh | bash -s -- 40132Or
iex "& { $(irm https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.ps1) } 40132" |
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues block approval of the change restoring custom shape dispatch for stroke-aware rendering.
No open issues 🎉
What changed in this PR
Restores custom IShape.PathForBounds dispatch for stroke-aware rendering, addressing the regression reported in #40129 while preserving built-in shape stroke behavior.
Changes:
- Routes stroke-aware path requests through
IShape, saving and restoring the stroke context withtry/finally. - Adds unit tests for custom shape dispatch, Border usage, and isolation of stroke context between calls.
| File | Description |
|---|---|
src/Controls/tests/Core.UnitTests/StrokeShapeTests.cs |
Adds regression coverage for custom dispatch and stroke-context isolation. |
src/Controls/src/Core/Shapes/Shape.cs |
Honors custom IShape implementations while preserving and restoring stroke context. |
Review effort: Balanced
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Expert Review — 0 findings
Reviewed commit 40ffa6e.
PR Test Gate
🧪 Gate analysis — click to expand⚠ Inconclusive. Setup, build, or execution did not produce a conclusive result. This does not prove the fix is incorrect. No interpretable test-group summary was produced. No additional test execution is inferred. Setup did not capture a verified PR head; no commit is claimed as tested. No immutable without-fix baseline was prepared. |
815bab9
into
dotnet:candidate/11.0.1xx-sr2
<!-- Please let the below note in for people that find this PR --> > [!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](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! <!-- Open .NET 11 fix PRs against net11 for review; target main for next-major features. After approval, a maintainer manually retargets the fix PR to the active inflight branch and merges it directly there. Do not merge individual fixes into net11. Bots must not retarget or merge. Candidate integration into net11 and release/* changes are separate, explicitly coordinated release work. --> ### Description of Change <!-- Enter description of the fix in this section --> Restore custom Shape implementations of `IShape.PathForBounds` when a renderer requests stroke-aware geometry. **Regression introduced by** [PR #37319 — Fix Rectangle Rendering as a Thin Line for Small Heights](#37319). The supplied reproduction works on MAUI `10.0.120` and fails on `10.0.130` on Android and iOS. **Root cause** That PR introduced the internal `IShapeWithStroke` interface to distinguish standalone shape geometry from Border stroke-aware geometry. Platform renderers were updated to prefer this interface over `IShape.PathForBounds`. Custom Shapes inherit `IShapeWithStroke` from `Shape`, even when they re-implement the public `IShape.PathForBounds` contract. The inherited stroke-aware implementation directly calls the base path-building method, bypassing the custom implementation. Applications cannot re-implement `IShapeWithStroke` because it is internal. In the reported `FieldShape`, the skipped method initializes the fallback width and height used to construct the outline. Without that call, the shape uses incorrect dimensions, producing a malformed outline instead of the expected rounded border and label gap. **Fix** - Dispatch `Shape.IShapeWithStroke.PathForBounds` through `IShape.PathForBounds`, honoring custom implementations. - Preserve the requested stroke context for built-in shapes using the base implementation. - Save and restore that context with `try`/`finally`, including when path generation throws. - Leave RoundRectangle's dedicated implementation unchanged. ### Issues Fixed <!-- Please make sure that there is a bug logged for the issue being fixed. The bug should describe the problem and how to reproduce it. --> Fixes #40129 <!-- Verify the target branch follows the release workflow in docs/ReleaseBranchWorkflow.md. Infrastructure and documentation changes should target the branch where they apply. --> --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Jakub Florkowski <42434498+kubaflo@users.noreply.github.com>
…on backports (#40217) <!-- Please let the below note in for people that find this PR --> > [!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](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! <!-- !!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING MAIN. !!!!!!! --> ### Description of Change **Explicit release-target exception:** this PR intentionally targets the new `release/10.0.1xx-sr14` branch. `main`, `net11` and the inflight lanes are now .NET 11, so .NET 10 SR14 is cut from the SR13 release head (`release/10.0.1xx-sr14` was created at `54d76458e0`, the tip of `release/10.0.1xx-sr13`, which already includes all post-cut SR13 fixes #39830, #39855, #39879, #39891 and the servicing/stable configuration from #39774). This PR brings the .NET 10 changes needed since SR13: 1. **Backport #39887** – `[Windows] Prevent duplicate Shell startup navigation from stale tab selection events`. Fixes #39859 (regressed in 10.0.120); it was merged only to `main`. Clean `cherry-pick -x`. 2. **Backport #40132** – `Fix custom Shape.PathForBounds dispatch regression`. Fixes #40129 (regressed in 10.0.130); it was merged only to `candidate/11.0.1xx-sr2`. The unrelated .NET 11 `eng/release-rollover.json` change from that commit is excluded (file does not exist on the .NET 10 line). 3. **Version bump** – `PatchVersion` 130 → 140 in `eng/Versions.props`. Servicing label and `StabilizePackageVersion=true` are inherited from SR13. Reviewed and intentionally **not** included: - #40136 (`net10.0` Publish-Build-Assets cleanup): SR13 has no `Publish-Build-Assets` references, so nothing to remove. - #39882 (re-land of the CollectionView2 height fix): SR13 already carries the revert #39855 that fixed #39847; re-landing is a fix-forward, not a regression fix. - #40213 (`[net10.0][XSG]` CA2252 suppression, issue #40045): still open/unmerged; can be backported once approved. - Other `regressed-in-10.0.1x0` issues closed since the SR13 cut (#38622, #39557/#39681, #39722) are already fixed on SR13 or were fixed outside MAUI. Keep in draft pending review and CI. This PR does not tag, publish, or authorize a release; the internal dnceng mirror of `release/10.0.1xx-sr14` has not been created. #### Validation Using the pinned SDK `10.0.113` provisioned by `eng/common/dotnet.sh`: - `dotnet msbuild eng/Versions.props -getProperty:PatchVersion,SdkBandVersion,PreReleaseVersionLabel,StabilizePackageVersion,DotNetFinalVersionKind` → `140`, `10.0.100`, `servicing`, `true`, `release`. `xmllint --noout eng/Versions.props` passed. - `dotnet test src/Controls/tests/Core.UnitTests/Controls.Core.UnitTests.csproj -f net10.0 --filter FullyQualifiedName~StrokeShapeTests` (platform TFMs disabled): **passed 59/59**. With `Shape.cs` reverted to SR13: **failed 3/59** (the new `CustomShapeReimplementingIShape*` tests); restored: **passed 59/59**. - #39887 is Windows-only (`ShellItemHandler.Windows.cs` + Windows device test) and was not built locally on macOS; it relies on CI. ### Issues Fixed Fixes #39859 Fixes #40129 <!-- Are you targeting main? All PRs should target the main branch unless otherwise noted. --> ---------
<!-- Please let the below note in for people that find this PR --> > [!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](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! <!-- Open .NET 11 fix PRs against net11 for review; target main for next-major features. After approval, a maintainer manually retargets the fix PR to the active inflight branch and merges it directly there. Do not merge individual fixes into net11. Bots must not retarget or merge. Candidate integration into net11 and release/* changes are separate, explicitly coordinated release work. --> ### Description of Change <!-- Enter description of the fix in this section --> Restore custom Shape implementations of `IShape.PathForBounds` when a renderer requests stroke-aware geometry. **Regression introduced by** [PR #37319 — Fix Rectangle Rendering as a Thin Line for Small Heights](#37319). The supplied reproduction works on MAUI `10.0.120` and fails on `10.0.130` on Android and iOS. **Root cause** That PR introduced the internal `IShapeWithStroke` interface to distinguish standalone shape geometry from Border stroke-aware geometry. Platform renderers were updated to prefer this interface over `IShape.PathForBounds`. Custom Shapes inherit `IShapeWithStroke` from `Shape`, even when they re-implement the public `IShape.PathForBounds` contract. The inherited stroke-aware implementation directly calls the base path-building method, bypassing the custom implementation. Applications cannot re-implement `IShapeWithStroke` because it is internal. In the reported `FieldShape`, the skipped method initializes the fallback width and height used to construct the outline. Without that call, the shape uses incorrect dimensions, producing a malformed outline instead of the expected rounded border and label gap. **Fix** - Dispatch `Shape.IShapeWithStroke.PathForBounds` through `IShape.PathForBounds`, honoring custom implementations. - Preserve the requested stroke context for built-in shapes using the base implementation. - Save and restore that context with `try`/`finally`, including when path generation throws. - Leave RoundRectangle's dedicated implementation unchanged. ### Issues Fixed <!-- Please make sure that there is a bug logged for the issue being fixed. The bug should describe the problem and how to reproduce it. --> Fixes #40129 <!-- Verify the target branch follows the release workflow in docs/ReleaseBranchWorkflow.md. Infrastructure and documentation changes should target the branch where they apply. --> --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Jakub Florkowski <42434498+kubaflo@users.noreply.github.com>
<!-- Please let the below note in for people that find this PR --> > [!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](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! <!-- Open .NET 11 fix PRs against net11 for review; target main for next-major features. After approval, a maintainer manually retargets the fix PR to the active inflight branch and merges it directly there. Do not merge individual fixes into net11. Bots must not retarget or merge. Candidate integration into net11 and release/* changes are separate, explicitly coordinated release work. --> ### Description of Change <!-- Enter description of the fix in this section --> Restore custom Shape implementations of `IShape.PathForBounds` when a renderer requests stroke-aware geometry. **Regression introduced by** [PR #37319 — Fix Rectangle Rendering as a Thin Line for Small Heights](#37319). The supplied reproduction works on MAUI `10.0.120` and fails on `10.0.130` on Android and iOS. **Root cause** That PR introduced the internal `IShapeWithStroke` interface to distinguish standalone shape geometry from Border stroke-aware geometry. Platform renderers were updated to prefer this interface over `IShape.PathForBounds`. Custom Shapes inherit `IShapeWithStroke` from `Shape`, even when they re-implement the public `IShape.PathForBounds` contract. The inherited stroke-aware implementation directly calls the base path-building method, bypassing the custom implementation. Applications cannot re-implement `IShapeWithStroke` because it is internal. In the reported `FieldShape`, the skipped method initializes the fallback width and height used to construct the outline. Without that call, the shape uses incorrect dimensions, producing a malformed outline instead of the expected rounded border and label gap. **Fix** - Dispatch `Shape.IShapeWithStroke.PathForBounds` through `IShape.PathForBounds`, honoring custom implementations. - Preserve the requested stroke context for built-in shapes using the base implementation. - Save and restore that context with `try`/`finally`, including when path generation throws. - Leave RoundRectangle's dedicated implementation unchanged. ### Issues Fixed <!-- Please make sure that there is a bug logged for the issue being fixed. The bug should describe the problem and how to reproduce it. --> Fixes #40129 <!-- Verify the target branch follows the release workflow in docs/ReleaseBranchWorkflow.md. Infrastructure and documentation changes should target the branch where they apply. --> --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Jakub Florkowski <42434498+kubaflo@users.noreply.github.com>
<!-- Please let the below note in for people that find this PR --> > [!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](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! <!-- Open .NET 11 fix PRs against net11 for review; target main for next-major features. After approval, a maintainer manually retargets the fix PR to the active inflight branch and merges it directly there. Do not merge individual fixes into net11. Bots must not retarget or merge. Candidate integration into net11 and release/* changes are separate, explicitly coordinated release work. --> ### Description of Change <!-- Enter description of the fix in this section --> Restore custom Shape implementations of `IShape.PathForBounds` when a renderer requests stroke-aware geometry. **Regression introduced by** [PR #37319 — Fix Rectangle Rendering as a Thin Line for Small Heights](#37319). The supplied reproduction works on MAUI `10.0.120` and fails on `10.0.130` on Android and iOS. **Root cause** That PR introduced the internal `IShapeWithStroke` interface to distinguish standalone shape geometry from Border stroke-aware geometry. Platform renderers were updated to prefer this interface over `IShape.PathForBounds`. Custom Shapes inherit `IShapeWithStroke` from `Shape`, even when they re-implement the public `IShape.PathForBounds` contract. The inherited stroke-aware implementation directly calls the base path-building method, bypassing the custom implementation. Applications cannot re-implement `IShapeWithStroke` because it is internal. In the reported `FieldShape`, the skipped method initializes the fallback width and height used to construct the outline. Without that call, the shape uses incorrect dimensions, producing a malformed outline instead of the expected rounded border and label gap. **Fix** - Dispatch `Shape.IShapeWithStroke.PathForBounds` through `IShape.PathForBounds`, honoring custom implementations. - Preserve the requested stroke context for built-in shapes using the base implementation. - Save and restore that context with `try`/`finally`, including when path generation throws. - Leave RoundRectangle's dedicated implementation unchanged. ### Issues Fixed <!-- Please make sure that there is a bug logged for the issue being fixed. The bug should describe the problem and how to reproduce it. --> Fixes #40129 <!-- Verify the target branch follows the release workflow in docs/ReleaseBranchWorkflow.md. Infrastructure and documentation changes should target the branch where they apply. --> --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Jakub Florkowski <42434498+kubaflo@users.noreply.github.com>
<!-- Please let the below note in for people that find this PR --> > [!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](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! <!-- Open .NET 11 fix PRs against net11 for review; target main for next-major features. After approval, a maintainer manually retargets the fix PR to the active inflight branch and merges it directly there. Do not merge individual fixes into net11. Bots must not retarget or merge. Candidate integration into net11 and release/* changes are separate, explicitly coordinated release work. --> ### Description of Change <!-- Enter description of the fix in this section --> Restore custom Shape implementations of `IShape.PathForBounds` when a renderer requests stroke-aware geometry. **Regression introduced by** [PR #37319 — Fix Rectangle Rendering as a Thin Line for Small Heights](#37319). The supplied reproduction works on MAUI `10.0.120` and fails on `10.0.130` on Android and iOS. **Root cause** That PR introduced the internal `IShapeWithStroke` interface to distinguish standalone shape geometry from Border stroke-aware geometry. Platform renderers were updated to prefer this interface over `IShape.PathForBounds`. Custom Shapes inherit `IShapeWithStroke` from `Shape`, even when they re-implement the public `IShape.PathForBounds` contract. The inherited stroke-aware implementation directly calls the base path-building method, bypassing the custom implementation. Applications cannot re-implement `IShapeWithStroke` because it is internal. In the reported `FieldShape`, the skipped method initializes the fallback width and height used to construct the outline. Without that call, the shape uses incorrect dimensions, producing a malformed outline instead of the expected rounded border and label gap. **Fix** - Dispatch `Shape.IShapeWithStroke.PathForBounds` through `IShape.PathForBounds`, honoring custom implementations. - Preserve the requested stroke context for built-in shapes using the base implementation. - Save and restore that context with `try`/`finally`, including when path generation throws. - Leave RoundRectangle's dedicated implementation unchanged. ### Issues Fixed <!-- Please make sure that there is a bug logged for the issue being fixed. The bug should describe the problem and how to reproduce it. --> Fixes #40129 <!-- Verify the target branch follows the release workflow in docs/ReleaseBranchWorkflow.md. Infrastructure and documentation changes should target the branch where they apply. --> --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Jakub Florkowski <42434498+kubaflo@users.noreply.github.com>
<!-- Please let the below note in for people that find this PR --> > [!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](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! <!-- Open .NET 11 fix PRs against net11 for review; target main for next-major features. After approval, a maintainer manually retargets the fix PR to the active inflight branch and merges it directly there. Do not merge individual fixes into net11. Bots must not retarget or merge. Candidate integration into net11 and release/* changes are separate, explicitly coordinated release work. --> ### Description of Change <!-- Enter description of the fix in this section --> Restore custom Shape implementations of `IShape.PathForBounds` when a renderer requests stroke-aware geometry. **Regression introduced by** [PR #37319 — Fix Rectangle Rendering as a Thin Line for Small Heights](#37319). The supplied reproduction works on MAUI `10.0.120` and fails on `10.0.130` on Android and iOS. **Root cause** That PR introduced the internal `IShapeWithStroke` interface to distinguish standalone shape geometry from Border stroke-aware geometry. Platform renderers were updated to prefer this interface over `IShape.PathForBounds`. Custom Shapes inherit `IShapeWithStroke` from `Shape`, even when they re-implement the public `IShape.PathForBounds` contract. The inherited stroke-aware implementation directly calls the base path-building method, bypassing the custom implementation. Applications cannot re-implement `IShapeWithStroke` because it is internal. In the reported `FieldShape`, the skipped method initializes the fallback width and height used to construct the outline. Without that call, the shape uses incorrect dimensions, producing a malformed outline instead of the expected rounded border and label gap. **Fix** - Dispatch `Shape.IShapeWithStroke.PathForBounds` through `IShape.PathForBounds`, honoring custom implementations. - Preserve the requested stroke context for built-in shapes using the base implementation. - Save and restore that context with `try`/`finally`, including when path generation throws. - Leave RoundRectangle's dedicated implementation unchanged. ### Issues Fixed <!-- Please make sure that there is a bug logged for the issue being fixed. The bug should describe the problem and how to reproduce it. --> Fixes #40129 <!-- Verify the target branch follows the release workflow in docs/ReleaseBranchWorkflow.md. Infrastructure and documentation changes should target the branch where they apply. --> --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Jakub Florkowski <42434498+kubaflo@users.noreply.github.com>
<!-- Please let the below note in for people that find this PR --> > [!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](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! <!-- Open .NET 11 fix PRs against net11 for review; target main for next-major features. After approval, a maintainer manually retargets the fix PR to the active inflight branch and merges it directly there. Do not merge individual fixes into net11. Bots must not retarget or merge. Candidate integration into net11 and release/* changes are separate, explicitly coordinated release work. --> ### Description of Change <!-- Enter description of the fix in this section --> Restore custom Shape implementations of `IShape.PathForBounds` when a renderer requests stroke-aware geometry. **Regression introduced by** [PR #37319 — Fix Rectangle Rendering as a Thin Line for Small Heights](#37319). The supplied reproduction works on MAUI `10.0.120` and fails on `10.0.130` on Android and iOS. **Root cause** That PR introduced the internal `IShapeWithStroke` interface to distinguish standalone shape geometry from Border stroke-aware geometry. Platform renderers were updated to prefer this interface over `IShape.PathForBounds`. Custom Shapes inherit `IShapeWithStroke` from `Shape`, even when they re-implement the public `IShape.PathForBounds` contract. The inherited stroke-aware implementation directly calls the base path-building method, bypassing the custom implementation. Applications cannot re-implement `IShapeWithStroke` because it is internal. In the reported `FieldShape`, the skipped method initializes the fallback width and height used to construct the outline. Without that call, the shape uses incorrect dimensions, producing a malformed outline instead of the expected rounded border and label gap. **Fix** - Dispatch `Shape.IShapeWithStroke.PathForBounds` through `IShape.PathForBounds`, honoring custom implementations. - Preserve the requested stroke context for built-in shapes using the base implementation. - Save and restore that context with `try`/`finally`, including when path generation throws. - Leave RoundRectangle's dedicated implementation unchanged. ### Issues Fixed <!-- Please make sure that there is a bug logged for the issue being fixed. The bug should describe the problem and how to reproduce it. --> Fixes #40129 <!-- Verify the target branch follows the release workflow in docs/ReleaseBranchWorkflow.md. Infrastructure and documentation changes should target the branch where they apply. --> --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Jakub Florkowski <42434498+kubaflo@users.noreply.github.com>
<!-- Please let the below note in for people that find this PR --> > [!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](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! <!-- Open .NET 11 fix PRs against net11 for review; target main for next-major features. After approval, a maintainer manually retargets the fix PR to the active inflight branch and merges it directly there. Do not merge individual fixes into net11. Bots must not retarget or merge. Candidate integration into net11 and release/* changes are separate, explicitly coordinated release work. --> ### Description of Change <!-- Enter description of the fix in this section --> Restore custom Shape implementations of `IShape.PathForBounds` when a renderer requests stroke-aware geometry. **Regression introduced by** [PR #37319 — Fix Rectangle Rendering as a Thin Line for Small Heights](#37319). The supplied reproduction works on MAUI `10.0.120` and fails on `10.0.130` on Android and iOS. **Root cause** That PR introduced the internal `IShapeWithStroke` interface to distinguish standalone shape geometry from Border stroke-aware geometry. Platform renderers were updated to prefer this interface over `IShape.PathForBounds`. Custom Shapes inherit `IShapeWithStroke` from `Shape`, even when they re-implement the public `IShape.PathForBounds` contract. The inherited stroke-aware implementation directly calls the base path-building method, bypassing the custom implementation. Applications cannot re-implement `IShapeWithStroke` because it is internal. In the reported `FieldShape`, the skipped method initializes the fallback width and height used to construct the outline. Without that call, the shape uses incorrect dimensions, producing a malformed outline instead of the expected rounded border and label gap. **Fix** - Dispatch `Shape.IShapeWithStroke.PathForBounds` through `IShape.PathForBounds`, honoring custom implementations. - Preserve the requested stroke context for built-in shapes using the base implementation. - Save and restore that context with `try`/`finally`, including when path generation throws. - Leave RoundRectangle's dedicated implementation unchanged. ### Issues Fixed <!-- Please make sure that there is a bug logged for the issue being fixed. The bug should describe the problem and how to reproduce it. --> Fixes #40129 <!-- Verify the target branch follows the release workflow in docs/ReleaseBranchWorkflow.md. Infrastructure and documentation changes should target the branch where they apply. --> --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Jakub Florkowski <42434498+kubaflo@users.noreply.github.com>
<!-- Please let the below note in for people that find this PR --> > [!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](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! <!-- Open .NET 11 fix PRs against net11 for review; target main for next-major features. After approval, a maintainer manually retargets the fix PR to the active inflight branch and merges it directly there. Do not merge individual fixes into net11. Bots must not retarget or merge. Candidate integration into net11 and release/* changes are separate, explicitly coordinated release work. --> ### Description of Change <!-- Enter description of the fix in this section --> Restore custom Shape implementations of `IShape.PathForBounds` when a renderer requests stroke-aware geometry. **Regression introduced by** [PR #37319 — Fix Rectangle Rendering as a Thin Line for Small Heights](#37319). The supplied reproduction works on MAUI `10.0.120` and fails on `10.0.130` on Android and iOS. **Root cause** That PR introduced the internal `IShapeWithStroke` interface to distinguish standalone shape geometry from Border stroke-aware geometry. Platform renderers were updated to prefer this interface over `IShape.PathForBounds`. Custom Shapes inherit `IShapeWithStroke` from `Shape`, even when they re-implement the public `IShape.PathForBounds` contract. The inherited stroke-aware implementation directly calls the base path-building method, bypassing the custom implementation. Applications cannot re-implement `IShapeWithStroke` because it is internal. In the reported `FieldShape`, the skipped method initializes the fallback width and height used to construct the outline. Without that call, the shape uses incorrect dimensions, producing a malformed outline instead of the expected rounded border and label gap. **Fix** - Dispatch `Shape.IShapeWithStroke.PathForBounds` through `IShape.PathForBounds`, honoring custom implementations. - Preserve the requested stroke context for built-in shapes using the base implementation. - Save and restore that context with `try`/`finally`, including when path generation throws. - Leave RoundRectangle's dedicated implementation unchanged. ### Issues Fixed <!-- Please make sure that there is a bug logged for the issue being fixed. The bug should describe the problem and how to reproduce it. --> Fixes #40129 <!-- Verify the target branch follows the release workflow in docs/ReleaseBranchWorkflow.md. Infrastructure and documentation changes should target the branch where they apply. --> --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Jakub Florkowski <42434498+kubaflo@users.noreply.github.com>
<!-- Please let the below note in for people that find this PR --> > [!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](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! <!-- Open .NET 11 fix PRs against net11 for review; target main for next-major features. After approval, a maintainer manually retargets the fix PR to the active inflight branch and merges it directly there. Do not merge individual fixes into net11. Bots must not retarget or merge. Candidate integration into net11 and release/* changes are separate, explicitly coordinated release work. --> ### Description of Change <!-- Enter description of the fix in this section --> Restore custom Shape implementations of `IShape.PathForBounds` when a renderer requests stroke-aware geometry. **Regression introduced by** [PR #37319 — Fix Rectangle Rendering as a Thin Line for Small Heights](#37319). The supplied reproduction works on MAUI `10.0.120` and fails on `10.0.130` on Android and iOS. **Root cause** That PR introduced the internal `IShapeWithStroke` interface to distinguish standalone shape geometry from Border stroke-aware geometry. Platform renderers were updated to prefer this interface over `IShape.PathForBounds`. Custom Shapes inherit `IShapeWithStroke` from `Shape`, even when they re-implement the public `IShape.PathForBounds` contract. The inherited stroke-aware implementation directly calls the base path-building method, bypassing the custom implementation. Applications cannot re-implement `IShapeWithStroke` because it is internal. In the reported `FieldShape`, the skipped method initializes the fallback width and height used to construct the outline. Without that call, the shape uses incorrect dimensions, producing a malformed outline instead of the expected rounded border and label gap. **Fix** - Dispatch `Shape.IShapeWithStroke.PathForBounds` through `IShape.PathForBounds`, honoring custom implementations. - Preserve the requested stroke context for built-in shapes using the base implementation. - Save and restore that context with `try`/`finally`, including when path generation throws. - Leave RoundRectangle's dedicated implementation unchanged. ### Issues Fixed <!-- Please make sure that there is a bug logged for the issue being fixed. The bug should describe the problem and how to reproduce it. --> Fixes #40129 <!-- Verify the target branch follows the release workflow in docs/ReleaseBranchWorkflow.md. Infrastructure and documentation changes should target the branch where they apply. --> --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Jakub Florkowski <42434498+kubaflo@users.noreply.github.com>
<!-- Please let the below note in for people that find this PR --> > [!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](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! <!-- Open .NET 11 fix PRs against net11 for review; target main for next-major features. After approval, a maintainer manually retargets the fix PR to the active inflight branch and merges it directly there. Do not merge individual fixes into net11. Bots must not retarget or merge. Candidate integration into net11 and release/* changes are separate, explicitly coordinated release work. --> ### Description of Change <!-- Enter description of the fix in this section --> Restore custom Shape implementations of `IShape.PathForBounds` when a renderer requests stroke-aware geometry. **Regression introduced by** [PR #37319 — Fix Rectangle Rendering as a Thin Line for Small Heights](#37319). The supplied reproduction works on MAUI `10.0.120` and fails on `10.0.130` on Android and iOS. **Root cause** That PR introduced the internal `IShapeWithStroke` interface to distinguish standalone shape geometry from Border stroke-aware geometry. Platform renderers were updated to prefer this interface over `IShape.PathForBounds`. Custom Shapes inherit `IShapeWithStroke` from `Shape`, even when they re-implement the public `IShape.PathForBounds` contract. The inherited stroke-aware implementation directly calls the base path-building method, bypassing the custom implementation. Applications cannot re-implement `IShapeWithStroke` because it is internal. In the reported `FieldShape`, the skipped method initializes the fallback width and height used to construct the outline. Without that call, the shape uses incorrect dimensions, producing a malformed outline instead of the expected rounded border and label gap. **Fix** - Dispatch `Shape.IShapeWithStroke.PathForBounds` through `IShape.PathForBounds`, honoring custom implementations. - Preserve the requested stroke context for built-in shapes using the base implementation. - Save and restore that context with `try`/`finally`, including when path generation throws. - Leave RoundRectangle's dedicated implementation unchanged. ### Issues Fixed <!-- Please make sure that there is a bug logged for the issue being fixed. The bug should describe the problem and how to reproduce it. --> Fixes #40129 <!-- Verify the target branch follows the release workflow in docs/ReleaseBranchWorkflow.md. Infrastructure and documentation changes should target the branch where they apply. --> --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Jakub Florkowski <42434498+kubaflo@users.noreply.github.com>
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
Restore custom Shape implementations of
IShape.PathForBoundswhen a renderer requests stroke-aware geometry.Regression introduced by
PR #37319 — Fix Rectangle Rendering as a Thin Line for Small Heights.
The supplied reproduction works on MAUI
10.0.120and fails on10.0.130on Android and iOS.Root cause
That PR introduced the internal
IShapeWithStrokeinterface to distinguish standalone shape geometry from Border stroke-aware geometry. Platform renderers were updated to prefer this interface overIShape.PathForBounds.Custom Shapes inherit
IShapeWithStrokefromShape, even when they re-implement the publicIShape.PathForBoundscontract. The inherited stroke-aware implementation directly calls the base path-building method, bypassing the custom implementation. Applications cannot re-implementIShapeWithStrokebecause it is internal.In the reported
FieldShape, the skipped method initializes the fallback width and height used to construct the outline. Without that call, the shape uses incorrect dimensions, producing a malformed outline instead of the expected rounded border and label gap.Fix
Shape.IShapeWithStroke.PathForBoundsthroughIShape.PathForBounds, honoring custom implementations.try/finally, including when path generation throws.Issues Fixed
Fixes #40129