Fix PlatformStringSizeService on iOS/Catalyst to use correct API#18621
Merged
drasticactions merged 2 commits intodotnet:mainfrom Nov 10, 2023
Merged
Fix PlatformStringSizeService on iOS/Catalyst to use correct API#18621drasticactions merged 2 commits intodotnet:mainfrom
drasticactions merged 2 commits intodotnet:mainfrom
Conversation
Contributor
Author
|
Also Re: the bounding box in the example above. There may be some math issues with how the calculation is done with the NSString Bounding Rect and the actual drawing with Skia. Depending on the font used, the literal bounding box could seem less than what's drawn based on the test code used, but as this is closer to correct than before if nothing else (and using the correct API) it should be good for now, and a new issue could be filed for the actual math should it be wrong. |
Contributor
Author
|
I am not sure why the Android test keeps failing, considering my change is only in iOS/Catalyst code and doesn't touch that part of the codebase at all. |
jsuarezruiz
approved these changes
Nov 10, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of Change
There is a wrapper check around PlatformStringSizeService to either use BoundingBox or StringSize to get the size of a given string. The original implementation was intended for iOS apps greater than version 14.0 to use BoundingBox and StringSize for everything else.
A negation in the check meant that it would do the opposite, and only work on iOS versions below 14.0. The check itself should not be needed in any case, as the baseline versions of MAUI are above iOS 7.0, which is the first version where that API was deprecated.
Likewise for Catalyst, this code would also not work correctly.
We should be able to remove the check and run the bounding rect code as is.
Issues Fixed
Fixes #18572