Skip to content
Advertisement

Tag: html5-canvas

How to keep drawing on canvas when scrolling?

I’m wanting to implement canvas as background for my website so users can use their cursors to paint on the webpage like this codepen: https://codepen.io/cocotx/pen/PoGRdxQ?editors=1010 (this is an example code from http://www.dgp.toronto.edu/~clwen/test/canvas-paint-tutorial/) The problem is that the cursor stops painting when I scroll until I move my mouse again. Any idea on how to keep cursor painting even when I

Promise never gets resolved in javascript

I have a asyn function in which I call another function that return a promise and also calls to another async function. Here is the code: since I have some asynchronous code to execute so I cannot invoke resolve() directly. so I use call back and the animate function itself is async doing a bunch of asynchronous stuff But the

Canvas 2DPath Clip overlap pr

I’m trying to create one compound shape in canvas that masks all the content below it – i will be animating these paths so they will eventually intersect – the problem is, when they intersect, they are doing a reverse mask when the drawing overlaps. I just want one solid mask. Here is an example ( as you can see

Weird shape when drawing line on canvas (js)

I’m trying to make a very simple paint in JS but I have a problem when I increase the line width it create weird shape at the end of shape but not when I use a lineWidth = 1 and I don’t know where the problem come from furthermore it create space between lines while with a lineWidth=1 I don’t

Pass headers in fabric Image.fromURL function

I am using fabric.js Image.fromURL function to load the image to canvas. For now, the images are loading successfully without any issues. But now I have a requirement to pass headers for authentication purposes is there a way that I could pass headers into the “Image.fromURL” function or any other way I could incorporate my headers to it. Answer Image.fromUrl

Advertisement