Skip to content

Fix for GetPosition truncates fractional coordinates to integers In OnTapped Event on iOS and MacCatalyst - #35949

Merged
kubaflo merged 3 commits into
dotnet:inflight/currentfrom
SuthiYuvaraj:Fix-Tapdecimal
Jul 1, 2026
Merged

Fix for GetPosition truncates fractional coordinates to integers In OnTapped Event on iOS and MacCatalyst#35949
kubaflo merged 3 commits into
dotnet:inflight/currentfrom
SuthiYuvaraj:Fix-Tapdecimal

Conversation

@SuthiYuvaraj

@SuthiYuvaraj SuthiYuvaraj commented Jun 16, 2026

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 Description

In Tapped event GetPosition EventArgs always returns a value without fractional part where as Android always returns the position with decimal parts.

Description of Change

Remove the (int) casts so the raw nfloat values flow directly into Point (which accepts double)

Root Cause:

In GesturePlatformManager.iOS.cs, the CalculatePosition() method — responsible for computing gesture coordinates for PointerEventArgs.GetPosition() — contained explicit (int) casts when constructing the returned Point
iOS/MacCatalyst gesture coordinates come from CGPoint, which uses nfloat (a native floating-point type). These casts to int silently truncate the fractional part

Issues Fixed

Fixes #35943

Tested the behaviour in the following platforms

  • Android
  • Windows
  • iOS
  • Mac

Output Screenshot

Before Issue Fix After Issue Fix
Before Fix After Fix

@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 -- 35949

Or

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

@dotnet-policy-service dotnet-policy-service Bot added the partner/syncfusion Issues / PR's with Syncfusion collaboration label Jun 16, 2026
@github-actions github-actions Bot added area-gestures Gesture types platform/ios platform/macos macOS / Mac Catalyst labels Jun 16, 2026
@SuthiYuvaraj SuthiYuvaraj changed the title Fix tapdecimal [WIP]Fix for GetPosition truncates fractional coordinates to integers In OnTapped Event on iOS and MacCatalyst Jun 16, 2026
@kubaflo

kubaflo commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

/review -b feature/enhanced-reviewer -p ios

@github-actions github-actions Bot added the s/agent-review-in-progress AI review is currently running for this PR label Jun 16, 2026
@MauiBot MauiBot added s/agent-fix-pr-picked AI could not beat the PR fix - PR is the best among all candidates s/agent-reviewed PR was reviewed by AI agent workflow (full 4-phase review) labels Jun 16, 2026
MauiBot

This comment was marked as outdated.

@MauiBot MauiBot removed the s/agent-review-in-progress AI review is currently running for this PR label Jun 16, 2026

@kubaflo kubaflo 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.

Is this one ready?

@kubaflo

This comment has been minimized.

@github-actions github-actions Bot added the s/agent-review-in-progress AI review is currently running for this PR label Jun 23, 2026
@MauiBot MauiBot added s/agent-gate-failed AI could not verify tests catch the bug s/agent-fix-win AI found a better alternative fix than the PR and removed s/agent-fix-pr-picked AI could not beat the PR fix - PR is the best among all candidates labels Jun 23, 2026
MauiBot

This comment was marked as outdated.

@MauiBot MauiBot removed the s/agent-review-in-progress AI review is currently running for this PR label Jun 23, 2026
@kubaflo
kubaflo marked this pull request as ready for review June 24, 2026 10:44
@kubaflo
kubaflo marked this pull request as draft June 24, 2026 10:45
@SuthiYuvaraj

Copy link
Copy Markdown
Contributor Author

@kubaflo , I reviewed the try-fix-1 idea and decided not to apply it.

Reason:

  • The current change removes integer truncation and preserves the original coordinate values end to end.
  • The suggested conversion path would still narrow values to float, which is less precise than the current direct double path.
  • The added UI test validates that fractional coordinates are preserved, which is the core issue being fixed.

So for this issue, I am keeping the current implementation because it is more precise and directly addresses the bug.

@kubaflo
kubaflo marked this pull request as ready for review June 26, 2026 12:53
Copilot AI review requested due to automatic review settings June 26, 2026 12:53
@github-actions github-actions Bot removed the s/agent-ready-for-rerun AI review has a new PR-author comment or commit and is ready for rerun label Jun 29, 2026
@MauiBot MauiBot removed the s/agent-review-in-progress AI review is currently running for this PR label Jun 29, 2026
@SuthiYuvaraj SuthiYuvaraj changed the title [WIP]Fix for GetPosition truncates fractional coordinates to integers In OnTapped Event on iOS and MacCatalyst Fix for GetPosition truncates fractional coordinates to integers In OnTapped Event on iOS and MacCatalyst Jun 30, 2026
@SuthiYuvaraj

Copy link
Copy Markdown
Contributor Author

@kubaflo, Thanks for the review. The previous test was already correctly validating the issue scenario, and it did catch the truncation behavior: when coordinates were truncated to integers, the page reported Failure; when fractional precision was preserved, it reported Success.

The update here is mainly to make the interaction more deterministic across runs (explicit integer tap coordinates), while keeping the same validation intent for the truncation bug.

@kubaflo

This comment has been minimized.

@github-actions github-actions Bot added the s/agent-review-in-progress AI review is currently running for this PR label Jul 1, 2026
@MauiBot MauiBot added s/agent-gate-passed AI verified tests catch the bug (fail without fix, pass with fix) s/agent-fix-pr-picked AI could not beat the PR fix - PR is the best among all candidates and removed s/agent-gate-failed AI could not verify tests catch the bug s/agent-fix-win AI found a better alternative fix than the PR labels Jul 1, 2026

@MauiBot MauiBot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

AI Review Summary

@SuthiYuvaraj — new AI review results are available based on this last commit: 59a7938. To request a fresh review after new comments or commits, comment /review rerun.

Gate Passed Confidence Low Platform iOS


🗂️ Review Sessions — click to expand
🚦 Gate — Test Before & After Fix

Gate Result: ✅ PASSED

Platform: IOS · Base: main · Merge base: fa1d0d2d

Test Without Fix (expect FAIL) With Fix (expect PASS)
🖥️ Issue35943 Issue35943 ✅ FAIL — 240s ✅ PASS — 90s
🔴 Without fix — 🖥️ Issue35943: FAIL ✅ · 240s
  Determining projects to restore...
  Restored /Users/cloudtest/vss/_work/1/s/src/Controls/src/BindingSourceGen/Controls.BindingSourceGen.csproj (in 423 ms).
  Restored /Users/cloudtest/vss/_work/1/s/src/Graphics/src/Graphics/Graphics.csproj (in 580 ms).
  Restored /Users/cloudtest/vss/_work/1/s/src/Essentials/src/Essentials.csproj (in 5.45 sec).
  Restored /Users/cloudtest/vss/_work/1/s/src/Controls/Foldable/src/Controls.Foldable.csproj (in 5.55 sec).
  Restored /Users/cloudtest/vss/_work/1/s/src/Controls/Maps/src/Controls.Maps.csproj (in 5.55 sec).
  Restored /Users/cloudtest/vss/_work/1/s/src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj (in 5.55 sec).
  Restored /Users/cloudtest/vss/_work/1/s/src/Controls/src/Core/Controls.Core.csproj (in 5.56 sec).
  Restored /Users/cloudtest/vss/_work/1/s/src/Core/src/Core.csproj (in 5.57 sec).
  Restored /Users/cloudtest/vss/_work/1/s/src/BlazorWebView/src/Maui/Microsoft.AspNetCore.Components.WebView.Maui.csproj (in 5.56 sec).
  Restored /Users/cloudtest/vss/_work/1/s/src/Core/maps/src/Maps.csproj (in 5.56 sec).
  Restored /Users/cloudtest/vss/_work/1/s/src/Controls/src/Xaml/Controls.Xaml.csproj (in 5.57 sec).
/Users/cloudtest/vss/_work/1/s/.dotnet/packs/Microsoft.iOS.Sdk.net10.0_26.0/26.0.11017/targets/Xamarin.Shared.Sdk.targets(309,3): warning : RuntimeIdentifier was set on the command line, and will override the value for RuntimeIdentifiers set in the project file. [/Users/cloudtest/vss/_work/1/s/src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj::TargetFramework=net10.0-ios]
  ##vso[build.updatebuildnumber]10.0.90-ci+azdo.14542232
  Graphics -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/Graphics/Debug/net10.0-ios26.0/Microsoft.Maui.Graphics.dll
  ##vso[build.updatebuildnumber]10.0.90-ci+azdo.14542232
  Essentials -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/Essentials/Debug/net10.0-ios26.0/Microsoft.Maui.Essentials.dll
  ##vso[build.updatebuildnumber]10.0.90-ci+azdo.14542232
  Core -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/Core/Debug/net10.0-ios26.0/Microsoft.Maui.dll
  ##vso[build.updatebuildnumber]10.0.90-ci+azdo.14542232
  Controls.BindingSourceGen -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/Controls.BindingSourceGen/Debug/netstandard2.0/Microsoft.Maui.Controls.BindingSourceGen.dll
  Maps -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/Maps/Debug/net10.0-ios26.0/Microsoft.Maui.Maps.dll
  ##vso[build.updatebuildnumber]10.0.90-ci+azdo.14542232
  Controls.Core -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/Controls.Core/Debug/net10.0-ios26.0/Microsoft.Maui.Controls.dll
  ##vso[build.updatebuildnumber]10.0.90-ci+azdo.14542232
  ##vso[build.updatebuildnumber]10.0.90-ci+azdo.14542232
  ##vso[build.updatebuildnumber]10.0.90-ci+azdo.14542232
  ##vso[build.updatebuildnumber]10.0.90-ci+azdo.14542232
  Microsoft.AspNetCore.Components.WebView.Maui -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/Microsoft.AspNetCore.Components.WebView.Maui/Debug/net10.0-ios26.0/Microsoft.AspNetCore.Components.WebView.Maui.dll
  Controls.Xaml -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/Controls.Xaml/Debug/net10.0-ios26.0/Microsoft.Maui.Controls.Xaml.dll
  Controls.Foldable -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/Controls.Foldable/Debug/net10.0-ios26.0/Microsoft.Maui.Controls.Foldable.dll
  Controls.Maps -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/Controls.Maps/Debug/net10.0-ios26.0/Microsoft.Maui.Controls.Maps.dll
  Detected signing identity:
    Code Signing Key: "" (-)
    Provisioning Profile: "" () - no entitlements
    Bundle Id: com.microsoft.maui.uitests
    App Id: com.microsoft.maui.uitests
  Controls.TestCases.HostApp -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/Controls.TestCases.HostApp/Debug/net10.0-ios/iossimulator-arm64/Controls.TestCases.HostApp.dll
  Optimizing assemblies for size may change the behavior of the app. Be sure to test after publishing. See: https://aka.ms/dotnet-illink
  Optimizing assemblies for size. This process might take a while.

Build succeeded.

/Users/cloudtest/vss/_work/1/s/.dotnet/packs/Microsoft.iOS.Sdk.net10.0_26.0/26.0.11017/targets/Xamarin.Shared.Sdk.targets(309,3): warning : RuntimeIdentifier was set on the command line, and will override the value for RuntimeIdentifiers set in the project file. [/Users/cloudtest/vss/_work/1/s/src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj::TargetFramework=net10.0-ios]
    1 Warning(s)
    0 Error(s)

Time Elapsed 00:01:57.71
  Determining projects to restore...
  Restored /Users/cloudtest/vss/_work/1/s/src/Graphics/src/Graphics/Graphics.csproj (in 639 ms).
  Restored /Users/cloudtest/vss/_work/1/s/src/Controls/tests/CustomAttributes/Controls.CustomAttributes.csproj (in 622 ms).
  Restored /Users/cloudtest/vss/_work/1/s/src/TestUtils/src/UITest.Core/UITest.Core.csproj (in 619 ms).
  Restored /Users/cloudtest/vss/_work/1/s/src/Essentials/src/Essentials.csproj (in 650 ms).
  Restored /Users/cloudtest/vss/_work/1/s/src/Controls/src/BindingSourceGen/Controls.BindingSourceGen.csproj (in 623 ms).
  Restored /Users/cloudtest/vss/_work/1/s/src/TestUtils/src/VisualTestUtils/VisualTestUtils.csproj (in 1 ms).
  Restored /Users/cloudtest/vss/_work/1/s/src/Core/src/Core.csproj (in 702 ms).
  Restored /Users/cloudtest/vss/_work/1/s/src/Controls/src/Core/Controls.Core.csproj (in 714 ms).
  Restored /Users/cloudtest/vss/_work/1/s/src/TestUtils/src/UITest.NUnit/UITest.NUnit.csproj (in 1.57 sec).
  Restored /Users/cloudtest/vss/_work/1/s/src/TestUtils/src/UITest.Appium/UITest.Appium.csproj (in 1.78 sec).
  Restored /Users/cloudtest/vss/_work/1/s/src/TestUtils/src/UITest.Analyzers/UITest.Analyzers.csproj (in 1.63 sec).
  Restored /Users/cloudtest/vss/_work/1/s/src/TestUtils/src/VisualTestUtils.MagickNet/VisualTestUtils.MagickNet.csproj (in 2.51 sec).
  Restored /Users/cloudtest/vss/_work/1/s/src/Controls/tests/TestCases.iOS.Tests/Controls.TestCases.iOS.Tests.csproj (in 2.52 sec).
  ##vso[build.updatebuildnumber]10.0.90-ci+azdo.14542232
  Controls.CustomAttributes -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/Controls.CustomAttributes/Debug/net10.0/Controls.CustomAttributes.dll
  Graphics -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/Graphics/Debug/net10.0/Microsoft.Maui.Graphics.dll
  ##vso[build.updatebuildnumber]10.0.90-ci+azdo.14542232
  Essentials -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/Essentials/Debug/net10.0/Microsoft.Maui.Essentials.dll
  ##vso[build.updatebuildnumber]10.0.90-ci+azdo.14542232
  Core -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/Core/Debug/net10.0/Microsoft.Maui.dll
  Controls.BindingSourceGen -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/Controls.BindingSourceGen/Debug/netstandard2.0/Microsoft.Maui.Controls.BindingSourceGen.dll
  ##vso[build.updatebuildnumber]10.0.90-ci+azdo.14542232
  Controls.Core -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/Controls.Core/Debug/net10.0/Microsoft.Maui.Controls.dll
  UITest.Core -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/UITest.Core/Debug/net10.0/UITest.Core.dll
  VisualTestUtils -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/VisualTestUtils/Debug/netstandard2.0/VisualTestUtils.dll
  VisualTestUtils.MagickNet -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/VisualTestUtils.MagickNet/Debug/netstandard2.0/VisualTestUtils.MagickNet.dll
  UITest.NUnit -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/UITest.NUnit/Debug/net10.0/UITest.NUnit.dll
  UITest.Appium -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/UITest.Appium/Debug/net10.0/UITest.Appium.dll
  UITest.Analyzers -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/UITest.Analyzers/Debug/netstandard2.0/UITest.Analyzers.dll
  Controls.TestCases.iOS.Tests -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/Controls.TestCases.iOS.Tests/Debug/net10.0/Controls.TestCases.iOS.Tests.dll
Test run for /Users/cloudtest/vss/_work/1/s/artifacts/bin/Controls.TestCases.iOS.Tests/Debug/net10.0/Controls.TestCases.iOS.Tests.dll (.NETCoreApp,Version=v10.0)
VSTest version 18.0.1 (arm64)

Starting test execution, please wait...
A total of 1 test files matched the specified pattern.
[xUnit.net 00:00:00.00] xUnit.net VSTest Adapter v2.8.2+699d445a1a (64-bit .NET 10.0.0)
[xUnit.net 00:00:00.05]   Discovering: Controls.TestCases.iOS.Tests
[xUnit.net 00:00:00.14]   Discovered:  Controls.TestCases.iOS.Tests
NUnit Adapter 4.5.0.0: Test execution started
Running selected tests in /Users/cloudtest/vss/_work/1/s/artifacts/bin/Controls.TestCases.iOS.Tests/Debug/net10.0/Controls.TestCases.iOS.Tests.dll
   NUnit3TestExecutor discovered 1 of 1 NUnit test cases using Current Discovery mode, Non-Explicit run
>>>>> 7/1/2026 8:24:58 AM FixtureSetup for Issue35943(iOS)
>>>>> 7/1/2026 8:25:03 AM GetPositionPreservesFractionalCoordinates Start
>>>>> 7/1/2026 8:25:18 AM GetPositionPreservesFractionalCoordinates Stop
>>>>> 7/1/2026 8:25:18 AM Log types: syslog, crashlog, performance, safariConsole, safariNetwork, server
  Failed GetPositionPreservesFractionalCoordinates [15 s]
  Error Message:
   System.TimeoutException : Timed out waiting for element...
  Stack Trace:
     at UITest.Appium.HelperExtensions.Wait(Func`1 query, Func`2 satisfactory, String timeoutMessage, Nullable`1 timeout, Nullable`1 retryFrequency) in /_/src/TestUtils/src/UITest.Appium/HelperExtensions.cs:line 2757
   at UITest.Appium.HelperExtensions.WaitForAtLeastOne(Func`1 query, String timeoutMessage, Nullable`1 timeout, Nullable`1 retryFrequency) in /_/src/TestUtils/src/UITest.Appium/HelperExtensions.cs:line 2784
   at UITest.Appium.HelperExtensions.WaitForElement(IApp app, String marked, String timeoutMessage, Nullable`1 timeout, Nullable`1 retryFrequency, Nullable`1 postTimeout) in /_/src/TestUtils/src/UITest.Appium/HelperExtensions.cs:line 793
   at Microsoft.Maui.TestCases.Tests.Issues.Issue35943.GetPositionPreservesFractionalCoordinates() in /_/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue35943.cs:line 29
   at System.Reflection.MethodBaseInvoker.InterpretedInvoke_Method(Object obj, IntPtr* args)
   at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)

NUnit Adapter 4.5.0.0: Test execution complete
Results File: /Users/cloudtest/vss/_work/1/s/CustomAgentLogsTmp/UITests/TestResults/Issue35943.trx

Test Run Failed.
Total tests: 1
     Failed: 1
 Total time: 1.3895 Minutes
>>> TRX_RESULT_FILE: /Users/cloudtest/vss/_work/1/s/CustomAgentLogsTmp/UITests/TestResults/Issue35943.trx

🟢 With fix — 🖥️ Issue35943: PASS ✅ · 90s
  Determining projects to restore...
  Restored /Users/cloudtest/vss/_work/1/s/src/Controls/src/BindingSourceGen/Controls.BindingSourceGen.csproj (in 460 ms).
  Restored /Users/cloudtest/vss/_work/1/s/src/Graphics/src/Graphics/Graphics.csproj (in 467 ms).
  Restored /Users/cloudtest/vss/_work/1/s/src/Essentials/src/Essentials.csproj (in 469 ms).
  Restored /Users/cloudtest/vss/_work/1/s/src/Controls/src/Core/Controls.Core.csproj (in 496 ms).
  Restored /Users/cloudtest/vss/_work/1/s/src/Core/src/Core.csproj (in 508 ms).
  6 of 11 projects are up-to-date for restore.
/Users/cloudtest/vss/_work/1/s/.dotnet/packs/Microsoft.iOS.Sdk.net10.0_26.0/26.0.11017/targets/Xamarin.Shared.Sdk.targets(309,3): warning : RuntimeIdentifier was set on the command line, and will override the value for RuntimeIdentifiers set in the project file. [/Users/cloudtest/vss/_work/1/s/src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj::TargetFramework=net10.0-ios]
  ##vso[build.updatebuildnumber]10.0.90-ci+azdo.14542232
  Graphics -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/Graphics/Debug/net10.0-ios26.0/Microsoft.Maui.Graphics.dll
  ##vso[build.updatebuildnumber]10.0.90-ci+azdo.14542232
  Essentials -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/Essentials/Debug/net10.0-ios26.0/Microsoft.Maui.Essentials.dll
  ##vso[build.updatebuildnumber]10.0.90-ci+azdo.14542232
  Core -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/Core/Debug/net10.0-ios26.0/Microsoft.Maui.dll
  ##vso[build.updatebuildnumber]10.0.90-ci+azdo.14542232
  Controls.BindingSourceGen -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/Controls.BindingSourceGen/Debug/netstandard2.0/Microsoft.Maui.Controls.BindingSourceGen.dll
  Maps -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/Maps/Debug/net10.0-ios26.0/Microsoft.Maui.Maps.dll
  ##vso[build.updatebuildnumber]10.0.90-ci+azdo.14542232
  Controls.Core -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/Controls.Core/Debug/net10.0-ios26.0/Microsoft.Maui.Controls.dll
  ##vso[build.updatebuildnumber]10.0.90-ci+azdo.14542232
  ##vso[build.updatebuildnumber]10.0.90-ci+azdo.14542232
  ##vso[build.updatebuildnumber]10.0.90-ci+azdo.14542232
  ##vso[build.updatebuildnumber]10.0.90-ci+azdo.14542232
  Controls.Maps -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/Controls.Maps/Debug/net10.0-ios26.0/Microsoft.Maui.Controls.Maps.dll
  Microsoft.AspNetCore.Components.WebView.Maui -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/Microsoft.AspNetCore.Components.WebView.Maui/Debug/net10.0-ios26.0/Microsoft.AspNetCore.Components.WebView.Maui.dll
  Controls.Foldable -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/Controls.Foldable/Debug/net10.0-ios26.0/Microsoft.Maui.Controls.Foldable.dll
  Controls.Xaml -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/Controls.Xaml/Debug/net10.0-ios26.0/Microsoft.Maui.Controls.Xaml.dll
  Detected signing identity:
    Code Signing Key: "" (-)
    Provisioning Profile: "" () - no entitlements
    Bundle Id: com.microsoft.maui.uitests
    App Id: com.microsoft.maui.uitests
  Controls.TestCases.HostApp -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/Controls.TestCases.HostApp/Debug/net10.0-ios/iossimulator-arm64/Controls.TestCases.HostApp.dll
  Optimizing assemblies for size may change the behavior of the app. Be sure to test after publishing. See: https://aka.ms/dotnet-illink
  Optimizing assemblies for size. This process might take a while.

Build succeeded.

/Users/cloudtest/vss/_work/1/s/.dotnet/packs/Microsoft.iOS.Sdk.net10.0_26.0/26.0.11017/targets/Xamarin.Shared.Sdk.targets(309,3): warning : RuntimeIdentifier was set on the command line, and will override the value for RuntimeIdentifiers set in the project file. [/Users/cloudtest/vss/_work/1/s/src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj::TargetFramework=net10.0-ios]
    1 Warning(s)
    0 Error(s)

Time Elapsed 00:00:44.80
  Determining projects to restore...
  Restored /Users/cloudtest/vss/_work/1/s/src/Controls/src/BindingSourceGen/Controls.BindingSourceGen.csproj (in 422 ms).
  Restored /Users/cloudtest/vss/_work/1/s/src/Graphics/src/Graphics/Graphics.csproj (in 394 ms).
  Restored /Users/cloudtest/vss/_work/1/s/src/Essentials/src/Essentials.csproj (in 434 ms).
  Restored /Users/cloudtest/vss/_work/1/s/src/Core/src/Core.csproj (in 458 ms).
  Restored /Users/cloudtest/vss/_work/1/s/src/Controls/src/Core/Controls.Core.csproj (in 474 ms).
  8 of 13 projects are up-to-date for restore.
  Controls.CustomAttributes -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/Controls.CustomAttributes/Debug/net10.0/Controls.CustomAttributes.dll
  ##vso[build.updatebuildnumber]10.0.90-ci+azdo.14542232
  Graphics -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/Graphics/Debug/net10.0/Microsoft.Maui.Graphics.dll
  ##vso[build.updatebuildnumber]10.0.90-ci+azdo.14542232
  Essentials -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/Essentials/Debug/net10.0/Microsoft.Maui.Essentials.dll
  ##vso[build.updatebuildnumber]10.0.90-ci+azdo.14542232
  Core -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/Core/Debug/net10.0/Microsoft.Maui.dll
  Controls.BindingSourceGen -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/Controls.BindingSourceGen/Debug/netstandard2.0/Microsoft.Maui.Controls.BindingSourceGen.dll
  ##vso[build.updatebuildnumber]10.0.90-ci+azdo.14542232
  Controls.Core -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/Controls.Core/Debug/net10.0/Microsoft.Maui.Controls.dll
  UITest.Core -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/UITest.Core/Debug/net10.0/UITest.Core.dll
  VisualTestUtils -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/VisualTestUtils/Debug/netstandard2.0/VisualTestUtils.dll
  UITest.Appium -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/UITest.Appium/Debug/net10.0/UITest.Appium.dll
  VisualTestUtils.MagickNet -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/VisualTestUtils.MagickNet/Debug/netstandard2.0/VisualTestUtils.MagickNet.dll
  UITest.NUnit -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/UITest.NUnit/Debug/net10.0/UITest.NUnit.dll
  UITest.Analyzers -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/UITest.Analyzers/Debug/netstandard2.0/UITest.Analyzers.dll
  Controls.TestCases.iOS.Tests -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/Controls.TestCases.iOS.Tests/Debug/net10.0/Controls.TestCases.iOS.Tests.dll
Test run for /Users/cloudtest/vss/_work/1/s/artifacts/bin/Controls.TestCases.iOS.Tests/Debug/net10.0/Controls.TestCases.iOS.Tests.dll (.NETCoreApp,Version=v10.0)
VSTest version 18.0.1 (arm64)

Starting test execution, please wait...
A total of 1 test files matched the specified pattern.
[xUnit.net 00:00:00.00] xUnit.net VSTest Adapter v2.8.2+699d445a1a (64-bit .NET 10.0.0)
[xUnit.net 00:00:00.04]   Discovering: Controls.TestCases.iOS.Tests
[xUnit.net 00:00:00.13]   Discovered:  Controls.TestCases.iOS.Tests
NUnit Adapter 4.5.0.0: Test execution started
Running selected tests in /Users/cloudtest/vss/_work/1/s/artifacts/bin/Controls.TestCases.iOS.Tests/Debug/net10.0/Controls.TestCases.iOS.Tests.dll
   NUnit3TestExecutor discovered 1 of 1 NUnit test cases using Current Discovery mode, Non-Explicit run
>>>>> 7/1/2026 8:26:45 AM FixtureSetup for Issue35943(iOS)
>>>>> 7/1/2026 8:26:49 AM GetPositionPreservesFractionalCoordinates Start
>>>>> 7/1/2026 8:26:49 AM GetPositionPreservesFractionalCoordinates Stop
  Passed GetPositionPreservesFractionalCoordinates [474 ms]
NUnit Adapter 4.5.0.0: Test execution complete
Results File: /Users/cloudtest/vss/_work/1/s/CustomAgentLogsTmp/UITests/TestResults/Issue35943.trx

Test Run Successful.
Total tests: 1
     Passed: 1
 Total time: 20.2098 Seconds
>>> TRX_RESULT_FILE: /Users/cloudtest/vss/_work/1/s/CustomAgentLogsTmp/UITests/TestResults/Issue35943.trx

📁 Fix files reverted (1 files)
  • src/Controls/src/Core/Platform/GestureManager/GesturePlatformManager.iOS.cs

📱 UI Tests — Gestures

Detected UI test categories: Gestures

Deep UI tests — 53 passed, 1 failed across 1 category on platform-pool agent (replaces in-process counts above).

🧪 UI Test Execution Results (deep, platform pool)

Category Tests Snapshot diffs
Gestures 53/55 (1 ❌)
Gestures — 1 failed test
PanGestureDoesNotFlickerWhenResizingView
Width change (0) should approximately match drag distance (100). Initial: 180, Final: 180
Assert.That(actualWidthChange, Is.EqualTo(dragDistance).Within(30))
  Expected: 100 +/- 30
  But was:  0
  Off by:   100.0d
at Microsoft.Maui.TestCases.Tests.Issues.Issue20772.PanGestureDoesNotFlickerWhenResizingView() in /_/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue20772.cs:line 47

1)    at Microsoft.Maui.TestCases.Tests.Issues.Issue20772.PanGestureDoesNotFlickerWhenResizingView() in /_/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue20772.cs:line 47

📎 Download drop-deep-uitests artifact (TRX + snapshot diffs)


📋 Pre-Flight — Context & Validation

Issue: #35943 - [iOS, MacCatalyst] GetPosition Truncates Fractional Coordinates to Integers on TappedEvent
PR: #35949 - Fix for GetPosition truncates fractional coordinates to integers In OnTapped Event on iOS and MacCatalyst
Platforms Affected: iOS, MacCatalyst
Files Changed: 1 implementation, 2 test

Key Findings

  • The PR targets GesturePlatformManager.iOS.cs, specifically CalculatePosition, where iOS/MacCatalyst gesture coordinates from CGPoint were truncated through explicit (int) casts.
  • The added UI test Issue35943 places a reference view at a half-point offset and taps integer screen coordinates, proving GetPosition(relativeTo:) must preserve fractional local coordinates.
  • Gate result was already completed separately and passed: Issue35943 failed without the fix and passed with the PR fix. Gate was not rerun in this phase.
  • gh CLI is unauthenticated in this environment, so authenticated PR metadata/check queries were unavailable; public GitHub API and local checkout data were used where possible.

Code Review Summary

Verdict: NEEDS_DISCUSSION
Confidence: low
Errors: 0 | Warnings: 0 | Suggestions: 0

Key code review findings:

  • ℹ No code findings from the independent code review or expert reviewer.
  • ℹ Confidence is capped low because gh pr checks --required could not run without authentication.
  • ℹ Blast radius is limited to iOS/MacCatalyst gesture GetPosition() calls; no startup/static-state impact was identified.

Fix Candidates

# Source Approach Test Result Files Changed Notes
PR PR #35949 Remove (int) casts at the two truncating CGPoint/originPoint to Point return sites in CalculatePosition. ✅ PASSED (Gate) GesturePlatformManager.iOS.cs Original PR fix; direct and minimal.

🔬 Code Review — Deep Analysis

Code Review — PR #35949

Independent Assessment

What this changes: Preserves fractional iOS/MacCatalyst tap coordinates by removing (int) truncation in GesturePlatformManager.iOS.cs:197,232. Adds Issue35943 UI coverage.
Inferred motivation: TappedEventArgs.GetPosition() was losing sub-point precision on iOS/MacCatalyst.

Reconciliation with PR Narrative

Author claims: Fixes #35943 by flowing nfloat/CGPoint values into Point.
Agreement/disagreement: Agrees with code and linked issue.

Prior Review Reconciliation

Prior ❌ Error Finding Source Status Evidence
Test did not catch bug / Android gate passed without fix MauiBot/kubaflo ✅ Fixed / 🔄 Obsolete Latest commit changed test to explicit integer TapCoordinates; Android gate was not the affected platform.
App.Tap("TapTarget") not deterministic Copilot inline ✅ Fixed Current test uses TapCoordinates((int)tapRect.CenterX(), ...).
Conditional AutomationId updates can lock state Copilot inline 🔄 Obsolete AutomationId may only be set once (Element.cs:81-90); single-tap test should fail if first result is Failure.

Blast Radius Assessment

  • Runs for all instances: Only iOS/MacCatalyst gesture GetPosition() calls.
  • Startup impact: No.
  • Static/shared state: No.

CI Status

  • Required-check result: gh pr checks --required unavailable because GitHub CLI is unauthenticated.
  • Public API evidence: 31 check runs; maui-pr, Build Analysis, and CLA completed successfully; one unrelated skipped check.
  • Classification: Required-check status technically undetermined.
  • Action taken: Used public API fallback; confidence capped low.

Findings

No code findings from this review or the expert reviewer.

Failure-Mode Probing

  • Null/disposed handler: Existing weak-reference/null checks still return null.
  • Non-fractional coordinates: Values are unchanged except no truncation.
  • Pointer/right-click fallback paths: Also preserve precision; no new lifecycle/subscription behavior.
  • Multiple taps on test page: Guard avoids resetting AutomationId and prevents setter exception.

Verdict: NEEDS_DISCUSSION

Confidence: low
Summary: Code changes look sound and targeted, with prior code-review issues addressed. I cannot issue LGTM under the skill rules because authenticated required-check status was unavailable, even though public check-run evidence looks green.


🛠️ Fix — Analysis & Comparison

Fix Candidates

# Source Approach Test Result Files Changed Notes
1 try-fix Helper-based CGPoint to Point conversion in CalculatePosition; replaces the two truncating return sites with ToPoint(...). ✅ PASS 1 file Preserves fractional values and documents conversion intent, but is slightly more code than the PR fix.
2 try-fix Recompute recognizer coordinates from platformRecognizer.View via UIKit ConvertPointToView, while preserving fractional values. ✅ PASS 1 file Meaningfully different algorithm, but riskier and not better because UIKit LocationInView(targetView) already does this conversion.
PR PR #35949 Directly remove (int) casts at the two truncating return sites. ✅ PASSED (Gate) 1 file Original PR; simplest passing fix so far.

Cross-Pollination

Model Round New Ideas? Details
maui-expert-reviewer 1 Yes Candidate 1: helper-based CGPoint conversion.
maui-expert-reviewer 1 Yes Candidate 2: explicit UIKit source-view coordinate conversion.
maui-expert-reviewer 2 No NO NEW IDEAS: the PR's cast removal is the minimal behavior-preserving fix; other passing approaches only wrap or reimplement the same UIKit coordinate conversion with added complexity/risk.

Exhausted: Yes
Selected Fix: PR's fix — it is the simplest passing solution. Candidate 1 also passes but only wraps the same conversion in a helper; candidate 2 passes but adds unnecessary UIKit conversion branching and lifecycle risk.


📝 Recommended PR Title & Description

Assessment: ✏️ Recommend updating — the current description is accurate, but the title does not follow the platform/component formula and the platform wording should consistently say MacCatalyst.

Recommended title

[iOS/MacCatalyst] Gestures: Preserve fractional GetPosition coordinates for tapped events

Recommended description

### Issue Description
In Tapped event GetPosition EventArgs always returns a value without fractional part whereas Android returns the position with decimal parts.

### Description of Change
Remove the `(int)` casts in `GesturePlatformManager.iOS.cs` so the raw `nfloat` values from UIKit flow directly into `Point` (which accepts `double`).

### Root Cause
In `GesturePlatformManager.iOS.cs`, the `CalculatePosition()` method — responsible for computing gesture coordinates for `PointerEventArgs.GetPosition()` / gesture event position callbacks — contained explicit `(int)` casts when constructing the returned `Point`.

iOS/MacCatalyst gesture coordinates come from `CGPoint`, which uses `nfloat` (a native floating-point type). These casts to `int` silently truncated the fractional part.

### Issues Fixed
Fixes #35943

### Tested the behaviour in the following platforms
- [ ] Android
- [ ] Windows
- [x] iOS
- [x] MacCatalyst

### Output Screenshot
Before Issue Fix | After Issue Fix |
|----------|----------|
|<image width="300" height="600" alt="Before Fix" src="https://github.com/user-attachments/assets/b5d0a1b7-173c-4f23-bfe3-5cb030beeeec">|<image width="300" height="600" alt="After Fix" src="https://github.com/user-attachments/assets/6957a05c-e4dc-4251-a907-8662cead60c6">|

🏁 Report — Final Recommendation

Comparative Fix Report — PR #35949

Candidates compared

Rank Candidate Regression result Assessment
1 pr ✅ Passed gate Best choice. Removes only the two truncating casts, preserves UIKit's existing coordinate-conversion behavior, and keeps the fix minimal.
2 pr-plus-reviewer ✅ Same as PR Expert reviewer found no actionable issues, so this candidate is identical to pr; it provides no additional improvement over the submitted fix.
3 try-fix-1 ✅ Passed Also correct, but adds a local helper that only wraps new Point(point.X, point.Y). The helper is harmless but unnecessary for a two-site conversion.
4 try-fix-2 ✅ Passed Preserves fractional values, but reimplements UIKit coordinate conversion with extra branching and a new dependency on platformRecognizer.View. This is riskier than using LocationInView(targetView) directly.

No candidate failed regression tests. If any had failed, it would have been ranked below all passing candidates.

Winning candidate

Winner: pr

The submitted PR is the single best fix because it directly removes the root-cause truncation while preserving the existing iOS/MacCatalyst coordinate-space logic. try-fix-1 is equivalent but more verbose, try-fix-2 is algorithmically riskier, and pr-plus-reviewer has no delta because expert review produced no actionable findings.


🧭 Next Steps — review latest findings

No alternative fix was selected for this run. Review the session findings and CI results before merging.

@MauiBot MauiBot removed the s/agent-review-in-progress AI review is currently running for this PR label Jul 1, 2026
@kubaflo
kubaflo changed the base branch from main to inflight/current July 1, 2026 22:26
@kubaflo
kubaflo merged commit 88585d0 into dotnet:inflight/current Jul 1, 2026
31 checks passed
@github-actions github-actions Bot added this to the .NET 10 SR9 milestone Jul 1, 2026
kubaflo pushed a commit that referenced this pull request Jul 3, 2026
…nTapped Event on iOS and MacCatalyst (#35949)

<!-- 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. !!!!!!!
-->
### Issue Description
In Tapped event GetPosition EventArgs always returns a value without
fractional part where as Android always returns the position with
decimal parts.

### Description of Change
Remove the (int) casts so the raw nfloat values flow directly into Point
(which accepts double)

### Root Cause:
In GesturePlatformManager.iOS.cs, the CalculatePosition() method —
responsible for computing gesture coordinates for
PointerEventArgs.GetPosition() — contained explicit (int) casts when
constructing the returned Point
iOS/MacCatalyst gesture coordinates come from CGPoint, which uses nfloat
(a native floating-point type). These casts to int silently truncate the
fractional part

### Issues Fixed
Fixes #35943 

### Tested the behaviour in the following platforms
- [ ] Android
- [ ] Windows
- [x] iOS
- [x] Mac


### Output Screenshot
Before Issue Fix | After Issue Fix |
|----------|----------|
|<image width="300" height="600" alt="Before Fix"
src="https://github.com/user-attachments/assets/b5d0a1b7-173c-4f23-bfe3-5cb030beeeec">|<image
width="300" height="600" alt="After Fix"
src="https://github.com/user-attachments/assets/6957a05c-e4dc-4251-a907-8662cead60c6">|
@kubaflo kubaflo mentioned this pull request Jul 6, 2026
kubaflo pushed a commit that referenced this pull request Jul 6, 2026
…nTapped Event on iOS and MacCatalyst (#35949)

<!-- 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. !!!!!!!
-->
### Issue Description
In Tapped event GetPosition EventArgs always returns a value without
fractional part where as Android always returns the position with
decimal parts.

### Description of Change
Remove the (int) casts so the raw nfloat values flow directly into Point
(which accepts double)

### Root Cause:
In GesturePlatformManager.iOS.cs, the CalculatePosition() method —
responsible for computing gesture coordinates for
PointerEventArgs.GetPosition() — contained explicit (int) casts when
constructing the returned Point
iOS/MacCatalyst gesture coordinates come from CGPoint, which uses nfloat
(a native floating-point type). These casts to int silently truncate the
fractional part

### Issues Fixed
Fixes #35943 

### Tested the behaviour in the following platforms
- [ ] Android
- [ ] Windows
- [x] iOS
- [x] Mac


### Output Screenshot
Before Issue Fix | After Issue Fix |
|----------|----------|
|<image width="300" height="600" alt="Before Fix"
src="https://github.com/user-attachments/assets/b5d0a1b7-173c-4f23-bfe3-5cb030beeeec">|<image
width="300" height="600" alt="After Fix"
src="https://github.com/user-attachments/assets/6957a05c-e4dc-4251-a907-8662cead60c6">|
PureWeen pushed a commit that referenced this pull request Jul 7, 2026
…nTapped Event on iOS and MacCatalyst (#35949)

<!-- 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. !!!!!!!
-->
### Issue Description
In Tapped event GetPosition EventArgs always returns a value without
fractional part where as Android always returns the position with
decimal parts.

### Description of Change
Remove the (int) casts so the raw nfloat values flow directly into Point
(which accepts double)

### Root Cause:
In GesturePlatformManager.iOS.cs, the CalculatePosition() method —
responsible for computing gesture coordinates for
PointerEventArgs.GetPosition() — contained explicit (int) casts when
constructing the returned Point
iOS/MacCatalyst gesture coordinates come from CGPoint, which uses nfloat
(a native floating-point type). These casts to int silently truncate the
fractional part

### Issues Fixed
Fixes #35943 

### Tested the behaviour in the following platforms
- [ ] Android
- [ ] Windows
- [x] iOS
- [x] Mac


### Output Screenshot
Before Issue Fix | After Issue Fix |
|----------|----------|
|<image width="300" height="600" alt="Before Fix"
src="https://github.com/user-attachments/assets/b5d0a1b7-173c-4f23-bfe3-5cb030beeeec">|<image
width="300" height="600" alt="After Fix"
src="https://github.com/user-attachments/assets/6957a05c-e4dc-4251-a907-8662cead60c6">|
PureWeen pushed a commit that referenced this pull request Jul 7, 2026
…nTapped Event on iOS and MacCatalyst (#35949)

<!-- 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. !!!!!!!
-->
### Issue Description
In Tapped event GetPosition EventArgs always returns a value without
fractional part where as Android always returns the position with
decimal parts.

### Description of Change
Remove the (int) casts so the raw nfloat values flow directly into Point
(which accepts double)

### Root Cause:
In GesturePlatformManager.iOS.cs, the CalculatePosition() method —
responsible for computing gesture coordinates for
PointerEventArgs.GetPosition() — contained explicit (int) casts when
constructing the returned Point
iOS/MacCatalyst gesture coordinates come from CGPoint, which uses nfloat
(a native floating-point type). These casts to int silently truncate the
fractional part

### Issues Fixed
Fixes #35943 

### Tested the behaviour in the following platforms
- [ ] Android
- [ ] Windows
- [x] iOS
- [x] Mac


### Output Screenshot
Before Issue Fix | After Issue Fix |
|----------|----------|
|<image width="300" height="600" alt="Before Fix"
src="https://github.com/user-attachments/assets/b5d0a1b7-173c-4f23-bfe3-5cb030beeeec">|<image
width="300" height="600" alt="After Fix"
src="https://github.com/user-attachments/assets/6957a05c-e4dc-4251-a907-8662cead60c6">|
kubaflo pushed a commit that referenced this pull request Jul 10, 2026
…nTapped Event on iOS and MacCatalyst (#35949)

<!-- 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. !!!!!!!
-->
### Issue Description
In Tapped event GetPosition EventArgs always returns a value without
fractional part where as Android always returns the position with
decimal parts.

### Description of Change
Remove the (int) casts so the raw nfloat values flow directly into Point
(which accepts double)

### Root Cause:
In GesturePlatformManager.iOS.cs, the CalculatePosition() method —
responsible for computing gesture coordinates for
PointerEventArgs.GetPosition() — contained explicit (int) casts when
constructing the returned Point
iOS/MacCatalyst gesture coordinates come from CGPoint, which uses nfloat
(a native floating-point type). These casts to int silently truncate the
fractional part

### Issues Fixed
Fixes #35943 

### Tested the behaviour in the following platforms
- [ ] Android
- [ ] Windows
- [x] iOS
- [x] Mac


### Output Screenshot
Before Issue Fix | After Issue Fix |
|----------|----------|
|<image width="300" height="600" alt="Before Fix"
src="https://github.com/user-attachments/assets/b5d0a1b7-173c-4f23-bfe3-5cb030beeeec">|<image
width="300" height="600" alt="After Fix"
src="https://github.com/user-attachments/assets/6957a05c-e4dc-4251-a907-8662cead60c6">|
kubaflo pushed a commit that referenced this pull request Jul 15, 2026
…nTapped Event on iOS and MacCatalyst (#35949)

<!-- 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. !!!!!!!
-->
### Issue Description
In Tapped event GetPosition EventArgs always returns a value without
fractional part where as Android always returns the position with
decimal parts.

### Description of Change
Remove the (int) casts so the raw nfloat values flow directly into Point
(which accepts double)

### Root Cause:
In GesturePlatformManager.iOS.cs, the CalculatePosition() method —
responsible for computing gesture coordinates for
PointerEventArgs.GetPosition() — contained explicit (int) casts when
constructing the returned Point
iOS/MacCatalyst gesture coordinates come from CGPoint, which uses nfloat
(a native floating-point type). These casts to int silently truncate the
fractional part

### Issues Fixed
Fixes #35943 

### Tested the behaviour in the following platforms
- [ ] Android
- [ ] Windows
- [x] iOS
- [x] Mac


### Output Screenshot
Before Issue Fix | After Issue Fix |
|----------|----------|
|<image width="300" height="600" alt="Before Fix"
src="https://github.com/user-attachments/assets/b5d0a1b7-173c-4f23-bfe3-5cb030beeeec">|<image
width="300" height="600" alt="After Fix"
src="https://github.com/user-attachments/assets/6957a05c-e4dc-4251-a907-8662cead60c6">|
kubaflo pushed a commit that referenced this pull request Jul 22, 2026
…nTapped Event on iOS and MacCatalyst (#35949)

<!-- 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. !!!!!!!
-->
### Issue Description
In Tapped event GetPosition EventArgs always returns a value without
fractional part where as Android always returns the position with
decimal parts.

### Description of Change
Remove the (int) casts so the raw nfloat values flow directly into Point
(which accepts double)

### Root Cause:
In GesturePlatformManager.iOS.cs, the CalculatePosition() method —
responsible for computing gesture coordinates for
PointerEventArgs.GetPosition() — contained explicit (int) casts when
constructing the returned Point
iOS/MacCatalyst gesture coordinates come from CGPoint, which uses nfloat
(a native floating-point type). These casts to int silently truncate the
fractional part

### Issues Fixed
Fixes #35943 

### Tested the behaviour in the following platforms
- [ ] Android
- [ ] Windows
- [x] iOS
- [x] Mac


### Output Screenshot
Before Issue Fix | After Issue Fix |
|----------|----------|
|<image width="300" height="600" alt="Before Fix"
src="https://github.com/user-attachments/assets/b5d0a1b7-173c-4f23-bfe3-5cb030beeeec">|<image
width="300" height="600" alt="After Fix"
src="https://github.com/user-attachments/assets/6957a05c-e4dc-4251-a907-8662cead60c6">|
kubaflo pushed a commit that referenced this pull request Jul 28, 2026
…nTapped Event on iOS and MacCatalyst (#35949)

<!-- 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. !!!!!!!
-->
### Issue Description
In Tapped event GetPosition EventArgs always returns a value without
fractional part where as Android always returns the position with
decimal parts.

### Description of Change
Remove the (int) casts so the raw nfloat values flow directly into Point
(which accepts double)

### Root Cause:
In GesturePlatformManager.iOS.cs, the CalculatePosition() method —
responsible for computing gesture coordinates for
PointerEventArgs.GetPosition() — contained explicit (int) casts when
constructing the returned Point
iOS/MacCatalyst gesture coordinates come from CGPoint, which uses nfloat
(a native floating-point type). These casts to int silently truncate the
fractional part

### Issues Fixed
Fixes #35943 

### Tested the behaviour in the following platforms
- [ ] Android
- [ ] Windows
- [x] iOS
- [x] Mac


### Output Screenshot
Before Issue Fix | After Issue Fix |
|----------|----------|
|<image width="300" height="600" alt="Before Fix"
src="https://github.com/user-attachments/assets/b5d0a1b7-173c-4f23-bfe3-5cb030beeeec">|<image
width="300" height="600" alt="After Fix"
src="https://github.com/user-attachments/assets/6957a05c-e4dc-4251-a907-8662cead60c6">|
kubaflo pushed a commit that referenced this pull request Jul 29, 2026
…nTapped Event on iOS and MacCatalyst (#35949)

<!-- 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. !!!!!!!
-->
### Issue Description
In Tapped event GetPosition EventArgs always returns a value without
fractional part where as Android always returns the position with
decimal parts.

### Description of Change
Remove the (int) casts so the raw nfloat values flow directly into Point
(which accepts double)

### Root Cause:
In GesturePlatformManager.iOS.cs, the CalculatePosition() method —
responsible for computing gesture coordinates for
PointerEventArgs.GetPosition() — contained explicit (int) casts when
constructing the returned Point
iOS/MacCatalyst gesture coordinates come from CGPoint, which uses nfloat
(a native floating-point type). These casts to int silently truncate the
fractional part

### Issues Fixed
Fixes #35943 

### Tested the behaviour in the following platforms
- [ ] Android
- [ ] Windows
- [x] iOS
- [x] Mac


### Output Screenshot
Before Issue Fix | After Issue Fix |
|----------|----------|
|<image width="300" height="600" alt="Before Fix"
src="https://github.com/user-attachments/assets/b5d0a1b7-173c-4f23-bfe3-5cb030beeeec">|<image
width="300" height="600" alt="After Fix"
src="https://github.com/user-attachments/assets/6957a05c-e4dc-4251-a907-8662cead60c6">|
@github-actions github-actions Bot locked and limited conversation to collaborators Aug 1, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-gestures Gesture types partner/syncfusion Issues / PR's with Syncfusion collaboration platform/ios platform/macos macOS / Mac Catalyst s/agent-fix-pr-picked AI could not beat the PR fix - PR is the best among all candidates s/agent-gate-passed AI verified tests catch the bug (fail without fix, pass with fix) s/agent-reviewed PR was reviewed by AI agent workflow (full 4-phase review)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[iOS, MacCatalyst] GetPosition Truncates Fractional Coordinates to Integers on TappedEvent

5 participants