Reputation: 1
I have an algorithm for Floodfilling a canvas. Im trying to incorporate this with fabricJS
. So here is the dilemna.... I create a fabric.Canvas()
. Which creates a wrapper canvas and also an upper-canvas canvas. I click on the canvas to apply my Floodfill()
. This works fine and applies my color. But as soon as i go to drag my canvas objects around, or add additional objects to the canvas, the color disappears and looks like it resets of sort.
Upvotes: 0
Views: 193
Reputation: 5
I have implemented flood fill algorithm in my project too and have taken inspiration from https://stackoverflow.com/a/52759579/9903046 You can see the final improved version of algorithm at https://github.com/Shivamc489/fabricjs-flood-fill This basically creates a image of the colored part and places atop the current objects, so your issue of color getting disappear also gets resolved.
Upvotes: 0