Skip to content

Point style does not seem to apply when passed a canvas element from node-canvas #11970

Answered by Taelar
Taelar asked this question in Q&A
Discussion options

You must be logged in to vote

In my desperation, I looked into the source code and its method drawPoint, and this caught my attention :

type = style.toString();
if (type === '[object HTMLImageElement]' || type === '[object HTMLCanvasElement]') {

So i tried to add to the above generateCustomPoint a 'dirty' line before the return
canvas.toString = () => '[object HTMLCanvasElement]'

And it does render my custom pointStyle with this (except it's not centered but that's still progress).

However I'm not a big fan of this solution, so I'm still interested if you have any other idea

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Taelar
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant