Skip to content

GraphicsView renders content outside of view #9183

Open
@epsmae

Description

@epsmae

Description

On Android If a Graphics View with a requested width and height is used and the content is scaled, the content is rendered outside of the view's dimensions. Additionally there seems to be an issue with text scaling (XAML Live Preview looks fine but on device not).
I also observed that on android the render cycle is called infinitely without calling invalidate whereas on windows/ios it is only called once, this is may connected.

Steps to Reproduce

  1. Clone Graphics view Sample https://github.com/dotnet/maui-samples/tree/main/6.0/UserInterface/Views/GraphicsViewDemos/GraphicsViewDemos
  2. Open ScaleTransformPage.xaml adjust width and height to 200
  3. Open ScaleTransformDrawable and add folowing to the start of the Draw method:
canvas.FillColor = Colors.LightGray;
canvas.FillRectangle(dirtyRect);
  1. Open ScaleTransformDrawable and increase scale to 3
  2. Observe that the second round rectangle is rendered outside of the view dimensions (gray background)

image

  1. Observe that on windows it looks fine
    image

Version with bug

6.0.400

Last version that worked well

Unknown/Other

Affected platforms

Android

Affected platform versions

Android 12

Did you find any workaround?

No but may I have to use skia sharp

Relevant log output

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-drawingShapes, Borders, Shadows, Graphics, BoxView, custom drawinghelp wanted[up-for-grabs] Good issue for external contributorsplatform/androids/triagedIssue has been revieweds/verifiedVerified / Reproducible Issue ready for Engineering Triaget/bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions