I am developing an application with HTML5 Canvas that displays a collection of shapes. On each shape I want one of the shape sides to have a stroke, but cannot do this without giving all sides a stroke or by using seperate lines and breaking the shape, stopping it from having a fill.
How would i draw a shape with a stroke on one side and a fill?
Thanks in advance.
One way is to call stroke when you aren’t fully done with the path, thus only stroking what you have already plotted out. Obviously though if you don’t draw the side first you want stroked this wont work, so there’s another option below.
Live Demo
This is just a quick dirty proof of concept function as another way to achieve what you’re looking for.
Live Demo 2