

VanquishedWombat


Konva - Point & shape collision detection
Thinking about shape-point collision detection in a case where there are many shapes on the stage, and how to improve performance. Here's my explanation of those functions and an possibly better approach.

Konva - making a shape fill the view
Someone asked on the Konva discord channel how to have a shape - in this case a group - be positioned and zoomed so that the shape fills the canvas view and is centered vertically and horizontally. Here's my answer...

Thinking about an approach to do-undo-redo
Coding a project that needs an undo-redo feature? Me too - here's my thinking from the end of the development on the subject based on my learnings coding a rich text editor.

Konva - Animation for HTML5 canvas
I wanted to learn about animation on the canvas so I'm making a smooth spiral animation of the first 199 words of David Bowie's 'Space Oddity' using the excellent Konva canvas library and its animation feature.

Konva - A workaround for inaccurate Path measuring via SVG
Long story short, Konvas path measuring for Path.getLength() and Path.getPointAtLength() methods are broken. The math involved is very complex and its not surprising that there are bugs. But also there's a simple and higher performance workaround so on balance its not so bad Lets take a look....

Konva - Stage.draw is dead, you did know, right?
If you know about Stage.draw() and that you don't need to worry about it any more, don't read this - put your feet up and have some coffee & cake. If you are at all fuzzy on the subject, read on...

Konva - HTML5 Canvas text on a path
The canvas does not yet provide the same level of character manipulation and measuring functions as we might find in the Windows GDI or similar. But it does give us canvas.measureText() to measure character size. Combine that with path.getPointAtLength() and we can fit text to a path.