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

Set background image for canvas. #22

Closed

Conversation

aravindhkumar23
Copy link

Add a background image to canvas via controller

Example updated with FAB to set background image (if Background image set the background colour is not taken into account.)

I hope this helps setting background image

@@ -143,14 +148,30 @@ class _PathHistory {
_inDrag = false;
}

void draw(Canvas canvas, Size size) {
void draw(Canvas canvas, Size size, Image image) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am a bit concerned about potential performance issues of this approach.

Because we cache path data (so its possible to undo), performance is worse with every new stroke.
That issue should be fixed some day, but it required much work due to advanced complexity.

Approach you introduced brings another weight to #draw method. I think that it would be much better if we just use flutter Stack widget to place background image under painting canvas.

@tmarzeion
Copy link
Collaborator

Thanks for contribution!
There is one minor thing that should be done before merging, please see PR review for more information :)

@EP-u-NW
Copy link
Collaborator

EP-u-NW commented May 24, 2021

The requested changes where not implemented since 10 months now, so I'm closing this.

@EP-u-NW EP-u-NW closed this May 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants