Kleki Blog

Select Prototype 3

general

New progress on the select tool prototype:

Previously the select tool used the even-odd rule for determining the selected area. This algorithm, while being simple, often leads to a selection with unintended holes:

even-odd selection

A different algorithm avoids these holes:

nonzero selection

The second image uses the nonzero rule, which is also what the prototype uses now. For that I switched from polybooljs to paperjs. It would add ~60kb to Kleki which I'm not totally happy with, and it seems to have some bugs with its nonzero implementation.

Furthermore, I updated how the selection outline is drawn and animated it, and made smaller usability improvements.

The algorithm behind the selection remains the main issue going forward.

Donate to Kleki via Paypal or Patreon!

-bitbof