Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[macOS/iOS] Border clipping incorrect when Content is scaled (or has any other Transform applied?) #17560

Open
jknaudt21 opened this issue Sep 21, 2023 · 5 comments
Labels
area-controls-border Border platform/iOS 🍎 platform/macOS 🍏 macOS / Mac Catalyst s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working
Milestone

Comments

@jknaudt21
Copy link
Contributor

Description

Mac counterpart of #17523

Screen.Recording.2023-09-20.at.4.25.10.PM.mov

Steps to Reproduce

Use the sample app "Border resize content" page

Link to public reproduction project repository

No response

Version with bug

8.0.0-rc.1.9171

Is this a regression from previous behavior?

Not sure, did not test other versions

Last version that worked well

Unknown/Other

Affected platforms

iOS, macOS

Affected platform versions

No response

Did you find any workaround?

No response

Relevant log output

No response

@jknaudt21 jknaudt21 added t/bug Something isn't working platform/macOS 🍏 macOS / Mac Catalyst platform/iOS 🍎 legacy-area-controls Label, Button, CheckBox, Slider, Stepper, Switch, Picker, Entry, Editor area-controls-border Border labels Sep 21, 2023
@jknaudt21 jknaudt21 self-assigned this Sep 21, 2023
@PureWeen PureWeen added this to the Backlog milestone Sep 22, 2023
@ghost
Copy link

ghost commented Sep 22, 2023

We've added this issue to our backlog, and we will work to address it as time and resources allow. If you have any additional information or questions about this issue, please leave a comment. For additional info about issue management, please read our Triage Process.

@jknaudt21
Copy link
Contributor Author

Upon investigating a bit further, this seems to be a problem with the Scale calculations. Both Image and Label have the same issues the moment their scale is changed.

@jstedfast
Copy link
Member

@jknaudt21 yes, it's the same on Android - it's related to the Scale transform (and likely other transforms will also have issues)

@jstedfast jstedfast changed the title Image Border clipping incorrect on Mac/iOS [macOS/iOS] Border clipping incorrect when Content is scaled (or has any other Transform applied?) Sep 27, 2023
@jstedfast jstedfast removed their assignment Sep 29, 2023
@jknaudt21
Copy link
Contributor Author

Dropping this issue as my work is being redirected outside of Maui. From what I started to investigate, this issue stems from the fact that the ContentView is:

  • Not adjusting the image's center correctly. Right now the mask is shifting around with the transform's applied to the mask. A bandaid fix is to force it to be centered based on the Frame. Something like adjustedMaskPosition = new(content.Frame.GetMidX(), content.Frame.GetMidY()
  • The mask is also resizing based on the transforms the image received. It shouldn't do that and instead transform to what the border was received. A bandaid fix is to do _contentMask.Transform = _contentMask.Transform.Concat(scaleTransform.Invert()), where the scaleTransform is just the M11, M22, and M33 positions of the transform matrix.

@jknaudt21 jknaudt21 removed their assignment Oct 20, 2023
@XamlTest XamlTest added s/verified Verified / Reproducible Issue ready for Engineering Triage s/triaged Issue has been reviewed labels Mar 15, 2024
@XamlTest
Copy link

Verified this on VS 17.10.0 Preview 2.0(8.0.7). Repro on iOS 17.2 and MacCatalyst with below Project:
BorderResizeContent.zip

@Eilon Eilon removed the legacy-area-controls Label, Button, CheckBox, Slider, Stepper, Switch, Picker, Entry, Editor label May 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-controls-border Border platform/iOS 🍎 platform/macOS 🍏 macOS / Mac Catalyst s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants