
Konva - using a shape's transform to rotate points
The Konva HTML5 canvas lib has a very useful feature that can spit out the transformations applied to a shape, and which we can borrow to rotate points without math. Lets take a look...
A tech blog giving usable explainers, advice, tools, tricks and techniques for the Konva JavaScript canvas library, the HTML5 canvas, and related subjects.
The Konva HTML5 canvas lib has a very useful feature that can spit out the transformations applied to a shape, and which we can borrow to rotate points without math. Lets take a look...
A user recently had a query regarding how to get the pixel color data for a point on the stage. This is quite easy, but there's a catch on high pixel density devices - think Apple devices like the MacBook and iPad. Here's the solution...
So I spent some time building a rich text editor as a side project. Here's some of what I learned which I'm sharing so you can avoid the bear traps and subsequent pain!
Working with non-English languages or emoji's and finding that strings get garbled or just don't add up? Let me try to explain why...
I was curious about how to close Konva lines, and I wanted to explore what we can do with lines and animation - here's where it ended up.
This was originally a StackOverflow question asked about 7 years ago. I preserve it here because the answer continues to receive upvotes, so seems of interest to some folks, and it was voted to close on SO.
When we exchange position and size information with Konva, multiple coordinate systems come into play. We normally use the canvas or stage coordinates but others are available. Knowing which to use will save a lot of frustration later. Lets investigate...
I mistakenly thought that a math-based mouse pointer hit testing approach might be faster than Konva's built-in approach. In the end I had to agree that Konva has it covered and there's no optimisation to be done. Here's the explanation...