2

I am making a drawing app with HTML5 CSS and JS. The purpose of it is to act like the usual drawing app; draw, layers, line size, and a paint bucket fill.

I don't know how to do this. I have tried ctx.fillRect but it cant fill in between the lines, and I don't think I can make a variable for the width and height of the lines. I have searched the entire face of Google and have found nothing.

Stack Overflow is my last hope. Please help.

  • Canvas is (mostly) for vector-based drawing, so you can only fill particular shapes. If you can construct a closed path from the intersecting shapes that you want to be filled, you can fill that path. – tromgy Jan 08 '22 at 16:49
  • Please share a [mcve] of your attempt. There are many ways to achieve this, but it's hard to make a recommendation that would fit your use case from scratch. If you provide code context, it's much easier to provide a relevant answer you can actually make use of. Thanks. – ggorlen Jan 08 '22 at 20:41

0 Answers0