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

[BUG] Android draws bitmap to entire canvas #2299

Open
jaredballen opened this issue Oct 31, 2022 · 0 comments
Open

[BUG] Android draws bitmap to entire canvas #2299

jaredballen opened this issue Oct 31, 2022 · 0 comments

Comments

@jaredballen
Copy link

I opened a discussion (here) a while back regarding some odd scaling that I was seeing when creating a "blurred" background affect on Android. I've since tracked the issue down to the SurfaceFactory.DrawSurface method. The approach to create the blurred view is the create a new canvas and manually draw a target view to it. This approach is nothing novel. When doing this, however, I have noticed though is that the native canvas passed to the DrawChild method of a SKCanvasViewRenderer, is NOT the size of immediate view but the size of the view on which the original draw request was made. Instead, the canvas has a clip region and translation applied to it. I have been able to work around this by creating my own SKCanvasViewRenderer.

In the base class's SurfaceFactory.DrawSurface method, the destination rect is set from (0, 0) on the canvas to the height and width of the canvas. I think that this needs to be changed to draw to the hight and width of the clipping region.

I would gladly implement this fix myself and post a PR; however, I have had a heck of a time getting the repo to build on my workstation.

Basic Information

  • Version with issue: At least 2.88.0 - I have not tested further back than that.
  • Last known good version: N/A
  • IDE: Visual Studio / Visual Studio for Mac / Rider
  • Platform Target Frameworks:
    • Android:
  • Target Devices:
    • Any Android Device
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: New
Development

No branches or pull requests

1 participant