@tsparticles/effect-trail
Advanced tools
Comparing version 3.2.2 to 3.3.0
import { getRangeValue, } from "@tsparticles/engine"; | ||
const double = 2, minTrailLength = 2, trailLengthOffset = 1, noItems = 0, half = 0.5, minWidth = -1, defaultLength = 10, defaultAlpha = 1; | ||
export class TrailDrawer { | ||
async draw(data) { | ||
draw(data) { | ||
const { context, radius, particle } = data, diameter = radius * double, pxRatio = particle.container.retina.pixelRatio, currentPos = particle.getPosition(); | ||
@@ -62,5 +62,4 @@ if (!particle.trail || !particle.trailLength) { | ||
context.setTransform(transformData.a, transformData.b, transformData.c, transformData.d, currentPos.x, currentPos.y); | ||
await Promise.resolve(); | ||
} | ||
async particleInit(container, particle) { | ||
particleInit(container, particle) { | ||
particle.trail = []; | ||
@@ -76,4 +75,3 @@ const effectData = particle.effectData; | ||
: undefined; | ||
await Promise.resolve(); | ||
} | ||
} |
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
var desc = Object.getOwnPropertyDescriptor(m, k); | ||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { | ||
desc = { enumerable: true, get: function() { return m[k]; } }; | ||
} | ||
Object.defineProperty(o, k2, desc); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { | ||
Object.defineProperty(o, "default", { enumerable: true, value: v }); | ||
}) : function(o, v) { | ||
o["default"] = v; | ||
}); | ||
var __importStar = (this && this.__importStar) || function (mod) { | ||
if (mod && mod.__esModule) return mod; | ||
var result = {}; | ||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); | ||
__setModuleDefault(result, mod); | ||
return result; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.loadTrailEffect = void 0; | ||
async function loadTrailEffect(engine, refresh = true) { | ||
const { TrailDrawer } = await Promise.resolve().then(() => __importStar(require("./TrailDrawer.js"))); | ||
const { TrailDrawer } = await import("./TrailDrawer.js"); | ||
await engine.addEffect("trail", new TrailDrawer(), refresh); | ||
} | ||
exports.loadTrailEffect = loadTrailEffect; |
@@ -7,3 +7,3 @@ "use strict"; | ||
class TrailDrawer { | ||
async draw(data) { | ||
draw(data) { | ||
const { context, radius, particle } = data, diameter = radius * double, pxRatio = particle.container.retina.pixelRatio, currentPos = particle.getPosition(); | ||
@@ -66,5 +66,4 @@ if (!particle.trail || !particle.trailLength) { | ||
context.setTransform(transformData.a, transformData.b, transformData.c, transformData.d, currentPos.x, currentPos.y); | ||
await Promise.resolve(); | ||
} | ||
async particleInit(container, particle) { | ||
particleInit(container, particle) { | ||
particle.trail = []; | ||
@@ -80,5 +79,4 @@ const effectData = particle.effectData; | ||
: undefined; | ||
await Promise.resolve(); | ||
} | ||
} | ||
exports.TrailDrawer = TrailDrawer; |
@@ -7,3 +7,3 @@ /*! | ||
* How to use? : Check the GitHub README | ||
* v3.2.2 | ||
* v3.3.0 | ||
*/ | ||
@@ -27,3 +27,3 @@ "use strict"; | ||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ TrailDrawer: () => (/* binding */ TrailDrawer)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__);\n\nconst double = 2,\n minTrailLength = 2,\n trailLengthOffset = 1,\n noItems = 0,\n half = 0.5,\n minWidth = -1,\n defaultLength = 10,\n defaultAlpha = 1;\nclass TrailDrawer {\n async draw(data) {\n const {\n context,\n radius,\n particle\n } = data,\n diameter = radius * double,\n pxRatio = particle.container.retina.pixelRatio,\n currentPos = particle.getPosition();\n if (!particle.trail || !particle.trailLength) {\n return;\n }\n const pathLength = particle.trailLength + radius;\n particle.trail.push({\n color: context.fillStyle ?? context.strokeStyle,\n position: {\n x: currentPos.x,\n y: currentPos.y\n }\n });\n if (particle.trail.length < minTrailLength) {\n return;\n }\n while (particle.trail.length > pathLength) {\n particle.trail.shift();\n }\n const trailLength = Math.min(particle.trail.length, pathLength),\n offsetPos = {\n x: currentPos.x,\n y: currentPos.y\n },\n canvasSize = {\n width: particle.container.canvas.size.width + diameter,\n height: particle.container.canvas.size.height + diameter\n };\n let lastPos = particle.trail[trailLength - trailLengthOffset].position;\n const defaultTransform = {\n a: 1,\n b: 0,\n c: 0,\n d: 1\n };\n context.setTransform(defaultTransform.a, defaultTransform.b, defaultTransform.c, defaultTransform.d, currentPos.x, currentPos.y);\n for (let i = trailLength; i > noItems; i--) {\n const step = particle.trail[i - trailLengthOffset],\n position = step.position;\n context.beginPath();\n context.moveTo(lastPos.x - offsetPos.x, lastPos.y - offsetPos.y);\n const warp = {\n x: (lastPos.x + canvasSize.width) % canvasSize.width,\n y: (lastPos.y + canvasSize.height) % canvasSize.height\n };\n if (Math.abs(lastPos.x - position.x) > canvasSize.width * half || Math.abs(lastPos.y - position.y) > canvasSize.height * half) {\n lastPos = position;\n continue;\n }\n context.lineTo((Math.abs(lastPos.x - position.x) > canvasSize.width * half ? warp.x : position.x) - offsetPos.x, (Math.abs(lastPos.y - position.y) > canvasSize.height * half ? warp.y : position.y) - offsetPos.y);\n const width = Math.max(i / trailLength * diameter, pxRatio, particle.trailMinWidth ?? minWidth),\n oldAlpha = context.globalAlpha;\n context.globalAlpha = particle.trailFade ? i / trailLength : defaultAlpha;\n context.lineWidth = particle.trailMaxWidth ? Math.min(width, particle.trailMaxWidth) : width;\n context.strokeStyle = step.color;\n context.stroke();\n context.globalAlpha = oldAlpha;\n lastPos = position;\n }\n const {\n transformData\n } = data;\n context.setTransform(transformData.a, transformData.b, transformData.c, transformData.d, currentPos.x, currentPos.y);\n await Promise.resolve();\n }\n async particleInit(container, particle) {\n particle.trail = [];\n const effectData = particle.effectData;\n particle.trailFade = effectData?.fade ?? true;\n particle.trailLength = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRangeValue)(effectData?.length ?? defaultLength) * container.retina.pixelRatio;\n particle.trailMaxWidth = effectData?.maxWidth ? (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRangeValue)(effectData.maxWidth) * container.retina.pixelRatio : undefined;\n particle.trailMinWidth = effectData?.minWidth ? (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRangeValue)(effectData.minWidth) * container.retina.pixelRatio : undefined;\n await Promise.resolve();\n }\n}\n\n//# sourceURL=webpack://@tsparticles/effect-trail/./dist/browser/TrailDrawer.js?"); | ||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ TrailDrawer: () => (/* binding */ TrailDrawer)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__);\n\nconst double = 2,\n minTrailLength = 2,\n trailLengthOffset = 1,\n noItems = 0,\n half = 0.5,\n minWidth = -1,\n defaultLength = 10,\n defaultAlpha = 1;\nclass TrailDrawer {\n draw(data) {\n const {\n context,\n radius,\n particle\n } = data,\n diameter = radius * double,\n pxRatio = particle.container.retina.pixelRatio,\n currentPos = particle.getPosition();\n if (!particle.trail || !particle.trailLength) {\n return;\n }\n const pathLength = particle.trailLength + radius;\n particle.trail.push({\n color: context.fillStyle ?? context.strokeStyle,\n position: {\n x: currentPos.x,\n y: currentPos.y\n }\n });\n if (particle.trail.length < minTrailLength) {\n return;\n }\n while (particle.trail.length > pathLength) {\n particle.trail.shift();\n }\n const trailLength = Math.min(particle.trail.length, pathLength),\n offsetPos = {\n x: currentPos.x,\n y: currentPos.y\n },\n canvasSize = {\n width: particle.container.canvas.size.width + diameter,\n height: particle.container.canvas.size.height + diameter\n };\n let lastPos = particle.trail[trailLength - trailLengthOffset].position;\n const defaultTransform = {\n a: 1,\n b: 0,\n c: 0,\n d: 1\n };\n context.setTransform(defaultTransform.a, defaultTransform.b, defaultTransform.c, defaultTransform.d, currentPos.x, currentPos.y);\n for (let i = trailLength; i > noItems; i--) {\n const step = particle.trail[i - trailLengthOffset],\n position = step.position;\n context.beginPath();\n context.moveTo(lastPos.x - offsetPos.x, lastPos.y - offsetPos.y);\n const warp = {\n x: (lastPos.x + canvasSize.width) % canvasSize.width,\n y: (lastPos.y + canvasSize.height) % canvasSize.height\n };\n if (Math.abs(lastPos.x - position.x) > canvasSize.width * half || Math.abs(lastPos.y - position.y) > canvasSize.height * half) {\n lastPos = position;\n continue;\n }\n context.lineTo((Math.abs(lastPos.x - position.x) > canvasSize.width * half ? warp.x : position.x) - offsetPos.x, (Math.abs(lastPos.y - position.y) > canvasSize.height * half ? warp.y : position.y) - offsetPos.y);\n const width = Math.max(i / trailLength * diameter, pxRatio, particle.trailMinWidth ?? minWidth),\n oldAlpha = context.globalAlpha;\n context.globalAlpha = particle.trailFade ? i / trailLength : defaultAlpha;\n context.lineWidth = particle.trailMaxWidth ? Math.min(width, particle.trailMaxWidth) : width;\n context.strokeStyle = step.color;\n context.stroke();\n context.globalAlpha = oldAlpha;\n lastPos = position;\n }\n const {\n transformData\n } = data;\n context.setTransform(transformData.a, transformData.b, transformData.c, transformData.d, currentPos.x, currentPos.y);\n }\n particleInit(container, particle) {\n particle.trail = [];\n const effectData = particle.effectData;\n particle.trailFade = effectData?.fade ?? true;\n particle.trailLength = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRangeValue)(effectData?.length ?? defaultLength) * container.retina.pixelRatio;\n particle.trailMaxWidth = effectData?.maxWidth ? (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRangeValue)(effectData.maxWidth) * container.retina.pixelRatio : undefined;\n particle.trailMinWidth = effectData?.minWidth ? (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRangeValue)(effectData.minWidth) * container.retina.pixelRatio : undefined;\n }\n}\n\n//# sourceURL=webpack://@tsparticles/effect-trail/./dist/browser/TrailDrawer.js?"); | ||
@@ -30,0 +30,0 @@ /***/ }) |
import { getRangeValue, } from "@tsparticles/engine"; | ||
const double = 2, minTrailLength = 2, trailLengthOffset = 1, noItems = 0, half = 0.5, minWidth = -1, defaultLength = 10, defaultAlpha = 1; | ||
export class TrailDrawer { | ||
async draw(data) { | ||
draw(data) { | ||
const { context, radius, particle } = data, diameter = radius * double, pxRatio = particle.container.retina.pixelRatio, currentPos = particle.getPosition(); | ||
@@ -62,5 +62,4 @@ if (!particle.trail || !particle.trailLength) { | ||
context.setTransform(transformData.a, transformData.b, transformData.c, transformData.d, currentPos.x, currentPos.y); | ||
await Promise.resolve(); | ||
} | ||
async particleInit(container, particle) { | ||
particleInit(container, particle) { | ||
particle.trail = []; | ||
@@ -76,4 +75,3 @@ const effectData = particle.effectData; | ||
: undefined; | ||
await Promise.resolve(); | ||
} | ||
} |
{ | ||
"name": "@tsparticles/effect-trail", | ||
"version": "3.2.2", | ||
"version": "3.3.0", | ||
"description": "tsParticles trail effect", | ||
@@ -103,3 +103,3 @@ "homepage": "https://particles.js.org", | ||
"dependencies": { | ||
"@tsparticles/engine": "^3.2.2" | ||
"@tsparticles/engine": "^3.3.0" | ||
}, | ||
@@ -106,0 +106,0 @@ "publishConfig": { |
@@ -7,3 +7,3 @@ /*! | ||
* How to use? : Check the GitHub README | ||
* v3.2.2 | ||
* v3.3.0 | ||
*/ | ||
@@ -214,3 +214,3 @@ /* | ||
/******/ var i = scripts.length - 1; | ||
/******/ while (i > -1 && !scriptUrl) scriptUrl = scripts[i--].src; | ||
/******/ while (i > -1 && (!scriptUrl || !/^http(s?):/.test(scriptUrl))) scriptUrl = scripts[i--].src; | ||
/******/ } | ||
@@ -217,0 +217,0 @@ /******/ } |
/*! For license information please see tsparticles.effect.trail.min.js.LICENSE.txt */ | ||
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("@tsparticles/engine"));else if("function"==typeof define&&define.amd)define(["@tsparticles/engine"],t);else{var r="object"==typeof exports?t(require("@tsparticles/engine")):t(e.window);for(var o in r)("object"==typeof exports?exports:e)[o]=r[o]}}(this,(e=>(()=>{var t,r,o={533:t=>{t.exports=e}},i={};function n(e){var t=i[e];if(void 0!==t)return t.exports;var r=i[e]={exports:{}};return o[e](r,r.exports,n),r.exports}n.m=o,n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.f={},n.e=e=>Promise.all(Object.keys(n.f).reduce(((t,r)=>(n.f[r](e,t),t)),[])),n.u=e=>e+".min.js",n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),t={},r="@tsparticles/effect-trail:",n.l=(e,o,i,a)=>{if(t[e])t[e].push(o);else{var l,s;if(void 0!==i)for(var c=document.getElementsByTagName("script"),u=0;u<c.length;u++){var f=c[u];if(f.getAttribute("src")==e||f.getAttribute("data-webpack")==r+i){l=f;break}}l||(s=!0,(l=document.createElement("script")).charset="utf-8",l.timeout=120,n.nc&&l.setAttribute("nonce",n.nc),l.setAttribute("data-webpack",r+i),l.src=e),t[e]=[o];var p=(r,o)=>{l.onerror=l.onload=null,clearTimeout(d);var i=t[e];if(delete t[e],l.parentNode&&l.parentNode.removeChild(l),i&&i.forEach((e=>e(o))),r)return r(o)},d=setTimeout(p.bind(null,void 0,{type:"timeout",target:l}),12e4);l.onerror=p.bind(null,l.onerror),l.onload=p.bind(null,l.onload),s&&document.head.appendChild(l)}},n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;n.g.importScripts&&(e=n.g.location+"");var t=n.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var r=t.getElementsByTagName("script");if(r.length)for(var o=r.length-1;o>-1&&!e;)e=r[o--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),n.p=e})(),(()=>{var e={242:0};n.f.j=(t,r)=>{var o=n.o(e,t)?e[t]:void 0;if(0!==o)if(o)r.push(o[2]);else{var i=new Promise(((r,i)=>o=e[t]=[r,i]));r.push(o[2]=i);var a=n.p+n.u(t),l=new Error;n.l(a,(r=>{if(n.o(e,t)&&(0!==(o=e[t])&&(e[t]=void 0),o)){var i=r&&("load"===r.type?"missing":r.type),a=r&&r.target&&r.target.src;l.message="Loading chunk "+t+" failed.\n("+i+": "+a+")",l.name="ChunkLoadError",l.type=i,l.request=a,o[1](l)}}),"chunk-"+t,t)}};var t=(t,r)=>{var o,i,a=r[0],l=r[1],s=r[2],c=0;if(a.some((t=>0!==e[t]))){for(o in l)n.o(l,o)&&(n.m[o]=l[o]);if(s)s(n)}for(t&&t(r);c<a.length;c++)i=a[c],n.o(e,i)&&e[i]&&e[i][0](),e[i]=0},r=this.webpackChunk_tsparticles_effect_trail=this.webpackChunk_tsparticles_effect_trail||[];r.forEach(t.bind(null,0)),r.push=t.bind(null,r.push.bind(r))})();var a={};return(()=>{async function e(e,t=!0){const{TrailDrawer:r}=await n.e(295).then(n.bind(n,295));await e.addEffect("trail",new r,t)}n.r(a),n.d(a,{loadTrailEffect:()=>e})})(),a})())); | ||
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("@tsparticles/engine"));else if("function"==typeof define&&define.amd)define(["@tsparticles/engine"],t);else{var r="object"==typeof exports?t(require("@tsparticles/engine")):t(e.window);for(var o in r)("object"==typeof exports?exports:e)[o]=r[o]}}(this,(e=>(()=>{var t,r,o={303:t=>{t.exports=e}},i={};function n(e){var t=i[e];if(void 0!==t)return t.exports;var r=i[e]={exports:{}};return o[e](r,r.exports,n),r.exports}n.m=o,n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.f={},n.e=e=>Promise.all(Object.keys(n.f).reduce(((t,r)=>(n.f[r](e,t),t)),[])),n.u=e=>e+".min.js",n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),t={},r="@tsparticles/effect-trail:",n.l=(e,o,i,a)=>{if(t[e])t[e].push(o);else{var s,l;if(void 0!==i)for(var c=document.getElementsByTagName("script"),u=0;u<c.length;u++){var p=c[u];if(p.getAttribute("src")==e||p.getAttribute("data-webpack")==r+i){s=p;break}}s||(l=!0,(s=document.createElement("script")).charset="utf-8",s.timeout=120,n.nc&&s.setAttribute("nonce",n.nc),s.setAttribute("data-webpack",r+i),s.src=e),t[e]=[o];var f=(r,o)=>{s.onerror=s.onload=null,clearTimeout(d);var i=t[e];if(delete t[e],s.parentNode&&s.parentNode.removeChild(s),i&&i.forEach((e=>e(o))),r)return r(o)},d=setTimeout(f.bind(null,void 0,{type:"timeout",target:s}),12e4);s.onerror=f.bind(null,s.onerror),s.onload=f.bind(null,s.onload),l&&document.head.appendChild(s)}},n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;n.g.importScripts&&(e=n.g.location+"");var t=n.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var r=t.getElementsByTagName("script");if(r.length)for(var o=r.length-1;o>-1&&(!e||!/^http(s?):/.test(e));)e=r[o--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),n.p=e})(),(()=>{var e={826:0};n.f.j=(t,r)=>{var o=n.o(e,t)?e[t]:void 0;if(0!==o)if(o)r.push(o[2]);else{var i=new Promise(((r,i)=>o=e[t]=[r,i]));r.push(o[2]=i);var a=n.p+n.u(t),s=new Error;n.l(a,(r=>{if(n.o(e,t)&&(0!==(o=e[t])&&(e[t]=void 0),o)){var i=r&&("load"===r.type?"missing":r.type),a=r&&r.target&&r.target.src;s.message="Loading chunk "+t+" failed.\n("+i+": "+a+")",s.name="ChunkLoadError",s.type=i,s.request=a,o[1](s)}}),"chunk-"+t,t)}};var t=(t,r)=>{var o,i,a=r[0],s=r[1],l=r[2],c=0;if(a.some((t=>0!==e[t]))){for(o in s)n.o(s,o)&&(n.m[o]=s[o]);if(l)l(n)}for(t&&t(r);c<a.length;c++)i=a[c],n.o(e,i)&&e[i]&&e[i][0](),e[i]=0},r=this.webpackChunk_tsparticles_effect_trail=this.webpackChunk_tsparticles_effect_trail||[];r.forEach(t.bind(null,0)),r.push=t.bind(null,r.push.bind(r))})();var a={};return(()=>{async function e(e,t=!0){const{TrailDrawer:r}=await n.e(892).then(n.bind(n,892));await e.addEffect("trail",new r,t)}n.r(a),n.d(a,{loadTrailEffect:()=>e})})(),a})())); |
@@ -1,1 +0,1 @@ | ||
/*! tsParticles Trail Shape v3.2.2 by Matteo Bruni */ | ||
/*! tsParticles Trail Shape v3.3.0 by Matteo Bruni */ |
@@ -14,5 +14,5 @@ import { type Container, type ICoordinates, type IEffectDrawer, type IShapeDrawData, type Particle } from "@tsparticles/engine"; | ||
export declare class TrailDrawer implements IEffectDrawer<TrailParticle> { | ||
draw(data: IShapeDrawData<TrailParticle>): Promise<void>; | ||
particleInit(container: Container, particle: TrailParticle): Promise<void>; | ||
draw(data: IShapeDrawData<TrailParticle>): void; | ||
particleInit(container: Container, particle: TrailParticle): void; | ||
} | ||
export {}; |
@@ -16,3 +16,3 @@ (function (factory) { | ||
class TrailDrawer { | ||
async draw(data) { | ||
draw(data) { | ||
const { context, radius, particle } = data, diameter = radius * double, pxRatio = particle.container.retina.pixelRatio, currentPos = particle.getPosition(); | ||
@@ -75,5 +75,4 @@ if (!particle.trail || !particle.trailLength) { | ||
context.setTransform(transformData.a, transformData.b, transformData.c, transformData.d, currentPos.x, currentPos.y); | ||
await Promise.resolve(); | ||
} | ||
async particleInit(container, particle) { | ||
particleInit(container, particle) { | ||
particle.trail = []; | ||
@@ -89,3 +88,2 @@ const effectData = particle.effectData; | ||
: undefined; | ||
await Promise.resolve(); | ||
} | ||
@@ -92,0 +90,0 @@ } |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Unidentified License
License(Experimental) Something that seems like a license was found, but its contents could not be matched with a known license.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Unidentified License
License(Experimental) Something that seems like a license was found, but its contents could not be matched with a known license.
Found 1 instance in 1 package
325292
755
Updated@tsparticles/engine@^3.3.0