maui
maui copied to clipboard
Entry Height gets updated when loaded inside the RoundRectangle Shape
RootCause
In the case of a rounded rectangle, the stroke thickness is added to the measured size during each Measure call. As a result, for every input in the Entry control, the width and height of the rounded rectangle are updated.
This issue was introduced due to the following PRs: Rendering Shapes without explicit bounds. by VSadov · Pull Request #5817 · dotnet/maui (github.com) Fixed Android RoundRectangle border logic by jstedfast · Pull Request #17087 · dotnet/maui (github.com)
While reverting change in above PR, current fix is fixed and issue mentioned above PR replicates.
Description of Change
The fix ensures that the stroke thickness is added to the measured size only once by using a flag variable. Additionally, to handle cases where the StrokeThickness changes at runtime, the flag variable is reset when the StrokeThickness is updated, allowing the new value to be applied correctly.
Issues Fixed
Fixes #18092
Tested the behaviour in the following platforms
- [x] Android
- [x] Windows
- [x] iOS
- [x] Mac
Output Videos
| Before Issue Fix | After Issue Fix |
|---|---|
/azp run
Azure Pipelines successfully started running 3 pipeline(s).
/azp run
Azure Pipelines successfully started running 3 pipeline(s).
/rebase
/azp run
Azure Pipelines successfully started running 3 pipeline(s).
/rebase
/azp run
Azure Pipelines successfully started running 3 pipeline(s).
Azure Pipelines successfully started running 3 pipeline(s).
Could we align the behavior between all the shapes? #25166 (comment)
reply : https://github.com/dotnet/maui/pull/25166#discussion_r1942875473
/azp run
Azure Pipelines successfully started running 3 pipeline(s).
@SuthiYuvaraj Could you rebase? Thanks in advance.
/azp run
Azure Pipelines successfully started running 3 pipeline(s).
/rebase
/azp run
Azure Pipelines successfully started running 3 pipeline(s).