src/layer/L.CanvasLayer.VectorFieldAnim.js
function _drawParticles() {
            // Previous paths...
            let prev = ctx.globalCompositeOperation;
            ctx.globalCompositeOperation = 'destination-in';
            ctx.fillRect(0, 0, ctx.canvas.width, ctx.canvas.height);
            //ctx.globalCompositeOperation = 'source-over';
            ctx.globalCompositeOperation = prev;

            // fading paths...
            ctx.fillStyle = `rgba(0, 0, 0, ${self.options.fade})`;
            ctx.lineWidth = self.options.width;
            ctx.strokeStyle = self.options.color;

            // New paths
            paths.forEach(function(par) {
                self._drawParticle(viewInfo, ctx, par);
            });
        }
function _drawParticles() {
            // Previous paths...
            let prev = ctx.globalCompositeOperation;
            ctx.globalCompositeOperation = 'destination-in';
            ctx.fillRect(0, 0, ctx.canvas.width, ctx.canvas.height);
            //ctx.globalCompositeOperation = 'source-over';
            ctx.globalCompositeOperation = prev;

            // fading paths...
            ctx.fillStyle = `rgba(0, 0, 0, ${self.options.fade})`;
            ctx.lineWidth = self.options.width;
            ctx.strokeStyle = self.options.color;

            // New paths
            paths.forEach(function(par) {
                self._drawParticle(viewInfo, ctx, par);
            });
        }
function _drawParticles ( ) { // Previous paths... let prev = ctx . globalCompositeOperation ; ctx . globalCompositeOperation = 'destination-in' ; ctx . fillRect ( 0 , 0 , ctx . canvas . width , ctx . canvas . height ) ; //ctx.globalCompositeOperation = 'source-over'; ctx . globalCompositeOperation = prev ; // fading paths... ctx . fillStyle = ` ${ self . options . fade } ` ; ctx . lineWidth = self . options . width ; ctx . strokeStyle = self . options . color ; // New paths paths . forEach ( function ( par ) { self . _drawParticle ( viewInfo , ctx , par ) ; } ) ; }
Draws the paths on each step
Draws the paths on each step