Friday, 24 May 2019

Is it possible to implement a Paint Bucket in Konva.js?

I’ve managed to implement, using konva, multiple tools that allow users to draw different shapes and patterns like: rectangle, circle, arrows, free draw, eraser, et. c.

I’m trying to achieve something like: using a paint bucket, users should be able to fill different parts of a shape, if over that shape are drawn other shapes or patterns.

Maybe this use case helps to understand better my question:

  1. The user draws a circle.
  2. Afterwards he draws lines over that circle so will be split in multiple areas.
  3. The user uses now the paint bucket and tries to fill only the areas of that circle.

I’m wondering if, using konva, is possible to achieve this functionality.

Until now I've manage only to fill entire shapes, similar to this.

Update

Added images for the use case above.

1 & 2. User draws a circle and lines over it: enter image description here

  1. Using paint bucket user can fill certain areas of that circle: enter image description here

Any feedback will be very welcomed.



from Is it possible to implement a Paint Bucket in Konva.js?

No comments:

Post a Comment