literallycanvas/literallycanvas — pull request #84 by campaul (2013-12-25 06:42:08+00:00)
Title: First pass at brushes and flow

This is slow.
This is a hack.
This is partially incorrect.
But it's a start.

If you select the pencil tool and do anything but 100% opacity you will see flow instead of global alpha. Setting the brush to about 12px and the opacity to about 75% looks really nice for demo purposes.

When this is merged some follow up tickets need to be opened:

Make brushes work with JSON import/export.
Importing and exporting still work, but the brush information is simply ignored. Right now we only have one brush so it doesn't really matter.

Fix the distribution algorithm.
For flow to work we need a set of points that are evenly distributed. The current solution gets really close, but still isn't quite right (you may notice the opacity of the line pulses a little). It also relies on several magic numbers.

Implement bitmap caching for flow.
While using flow is inherently slower than drawing polygons, it is much easier to build a caching layer around. Once this is done it should actually be faster than the polygon based solution we currently use.

Create our own Color class.
This needs structured data to fiddle with alpha, so we need to build a color class. For this branch I used a dict with rgba values, but I have a real color class coming down the pipe with the new color picker.