question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Great work on the library so far. One gripe I have found is that there is no native implementation of drawHitFromCache (or even cache for that matter) on Image. You can work around it by storing a reference and setting the properties directly on the konva object but wouldn’t it be much nicer to have this inside react-konva ?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
lavrtoncommented, Dec 12, 2018

We need to think how to implement it. Probably we can do this:

<Image
   {...someProps}
   applyCache
   applyHitFromCache
/>

react-konva will try to automatically cache a node when possible.

0reactions
lavrtoncommented, Jul 19, 2019

@heaversm yeh, you just need to call that method manually when a component is mounted.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Detecting image events for non-transparent pixels only ...
According to the doc, in order to have the event detection only for non-transparent pixels, I have to call methods cache() and drawHitFromCache...
Read more >
HTML5 Canvas Image Events with Konva
To only detect events for non transparent pixels in an image with Konva, we can use the drawHitFromCache() method to generate a more...
Read more >
JavaScript konva Image.drawHitFromCache Examples
drawHitFromCache - 2 examples found. These are the top rated real world JavaScript examples of konva.Image.drawHitFromCache extracted from open source ...
Read more >
Detecting image events for non-transparent pixels only ...
Coding example for the question Detecting image events for non-transparent pixels only (drawHitFromCache) in Vue Konva-Vue.js.
Read more >
konvajs/konva - Gitter
use drawHitFromCache,. konva.js:2771 Uncaught TypeError: Cannot read property 'scene' of undefined at Image.Node._getCachedSceneCanvas (konva.js:2771)
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found