@tsparticles/shape-path 3.0.0-beta.1 → 3.0.0-beta.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4,7 +4,7 @@
4
4
  * Demo / Generator : https://particles.js.org/
5
5
  * GitHub : https://www.github.com/matteobruni/tsparticles
6
6
  * How to use? : Check the GitHub README
7
- * v3.0.0-beta.1
7
+ * v3.0.0-beta.3
8
8
  */
9
9
  (function webpackUniversalModuleDefinition(root, factory) {
10
10
  if(typeof exports === 'object' && typeof module === 'object')
@@ -140,7 +140,12 @@ function drawPath(ctx, radius, path) {
140
140
 
141
141
 
142
142
  class PathDrawer {
143
- draw(context, particle, radius) {
143
+ draw(data) {
144
+ const {
145
+ context,
146
+ particle,
147
+ radius
148
+ } = data;
144
149
  if (!particle.pathData) {
145
150
  return;
146
151
  }
@@ -1,2 +1,2 @@
1
1
  /*! For license information please see tsparticles.shape.path.min.js.LICENSE.txt */
2
- !function(e,a){if("object"==typeof exports&&"object"==typeof module)module.exports=a(require("@tsparticles/engine"));else if("function"==typeof define&&define.amd)define(["@tsparticles/engine"],a);else{var s="object"==typeof exports?a(require("@tsparticles/engine")):a(e.window);for(var t in s)("object"==typeof exports?exports:e)[t]=s[t]}}(this,(e=>(()=>{"use strict";var a={533:a=>{a.exports=e}},s={};function t(e){var r=s[e];if(void 0!==r)return r.exports;var l=s[e]={exports:{}};return a[e](l,l.exports,t),l.exports}t.d=(e,a)=>{for(var s in a)t.o(a,s)&&!t.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:a[s]})},t.o=(e,a)=>Object.prototype.hasOwnProperty.call(e,a),t.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};return(()=>{t.r(r),t.d(r,{loadPathShape:()=>s});var e=t(533);class a{draw(e,a,s){a.pathData&&function(e,a,s){e.moveTo(s.segments[0].values[0].x*a,s.segments[0].values[0].y*a);for(let t=0;t<s.segments.length;t++){const r=s.segments[t];switch(r.type){case"line":e.lineTo(r.values[0].x*a,r.values[0].y*a);break;case"bezier":e.bezierCurveTo(r.values[1].x*a,r.values[1].y*a,r.values[2].x*a,r.values[2].y*a,r.values[3].x*a,r.values[3].y*a);break;case"quadratic":e.quadraticCurveTo(r.values[1].x*a,r.values[1].y*a,r.values[2].x*a,r.values[2].y*a);break;case"arc":e.arc(r.values[0].x*a,r.values[0].y*a,r.values[1].x*a,r.values[2].x,r.values[2].y);break;case"ellipse":e.ellipse(r.values[0].x*a,r.values[0].y*a,r.values[1].x*a,r.values[1].y*a,r.values[2].x,r.values[3].x,r.values[3].y)}}if(s.half)for(let t=s.segments.length-1;t>=0;t--){const r=s.segments[t];switch(r.type){case"line":e.lineTo(r.values[0].x*-a,r.values[0].y*a);break;case"bezier":e.bezierCurveTo(-r.values[2].x*a,r.values[2].y*a,-r.values[1].x*a,r.values[1].y*a,-r.values[0].x*a,r.values[0].y*a);break;case"quadratic":e.quadraticCurveTo(-r.values[1].x*a,r.values[1].y*a,-r.values[2].x*a,r.values[2].y*a)}}}(e,s,a.pathData)}particleInit(a,s){const t=s.shapeData;t&&(s.pathData=(0,e.deepExtend)({},t))}}async function s(e,s=!0){await e.addShape("path",new a,s)}})(),r})()));
2
+ !function(e,a){if("object"==typeof exports&&"object"==typeof module)module.exports=a(require("@tsparticles/engine"));else if("function"==typeof define&&define.amd)define(["@tsparticles/engine"],a);else{var s="object"==typeof exports?a(require("@tsparticles/engine")):a(e.window);for(var t in s)("object"==typeof exports?exports:e)[t]=s[t]}}(this,(e=>(()=>{"use strict";var a={533:a=>{a.exports=e}},s={};function t(e){var r=s[e];if(void 0!==r)return r.exports;var l=s[e]={exports:{}};return a[e](l,l.exports,t),l.exports}t.d=(e,a)=>{for(var s in a)t.o(a,s)&&!t.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:a[s]})},t.o=(e,a)=>Object.prototype.hasOwnProperty.call(e,a),t.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};return(()=>{t.r(r),t.d(r,{loadPathShape:()=>s});var e=t(533);class a{draw(e){const{context:a,particle:s,radius:t}=e;s.pathData&&function(e,a,s){e.moveTo(s.segments[0].values[0].x*a,s.segments[0].values[0].y*a);for(let t=0;t<s.segments.length;t++){const r=s.segments[t];switch(r.type){case"line":e.lineTo(r.values[0].x*a,r.values[0].y*a);break;case"bezier":e.bezierCurveTo(r.values[1].x*a,r.values[1].y*a,r.values[2].x*a,r.values[2].y*a,r.values[3].x*a,r.values[3].y*a);break;case"quadratic":e.quadraticCurveTo(r.values[1].x*a,r.values[1].y*a,r.values[2].x*a,r.values[2].y*a);break;case"arc":e.arc(r.values[0].x*a,r.values[0].y*a,r.values[1].x*a,r.values[2].x,r.values[2].y);break;case"ellipse":e.ellipse(r.values[0].x*a,r.values[0].y*a,r.values[1].x*a,r.values[1].y*a,r.values[2].x,r.values[3].x,r.values[3].y)}}if(s.half)for(let t=s.segments.length-1;t>=0;t--){const r=s.segments[t];switch(r.type){case"line":e.lineTo(r.values[0].x*-a,r.values[0].y*a);break;case"bezier":e.bezierCurveTo(-r.values[2].x*a,r.values[2].y*a,-r.values[1].x*a,r.values[1].y*a,-r.values[0].x*a,r.values[0].y*a);break;case"quadratic":e.quadraticCurveTo(-r.values[1].x*a,r.values[1].y*a,-r.values[2].x*a,r.values[2].y*a)}}}(a,t,s.pathData)}particleInit(a,s){const t=s.shapeData;t&&(s.pathData=(0,e.deepExtend)({},t))}}async function s(e,s=!0){await e.addShape("path",new a,s)}})(),r})()));
@@ -1 +1 @@
1
- /*! tsParticles Path Shape v3.0.0-beta.1 by Matteo Bruni */
1
+ /*! tsParticles Path Shape v3.0.0-beta.3 by Matteo Bruni */
@@ -1,6 +1,6 @@
1
- import { type Container, type IShapeDrawer } from "@tsparticles/engine";
1
+ import { type Container, type IShapeDrawData, type IShapeDrawer } from "@tsparticles/engine";
2
2
  import type { PathParticle } from "./PathParticle.js";
3
- export declare class PathDrawer implements IShapeDrawer {
4
- draw(context: CanvasRenderingContext2D, particle: PathParticle, radius: number): void;
3
+ export declare class PathDrawer implements IShapeDrawer<PathParticle> {
4
+ draw(data: IShapeDrawData<PathParticle>): void;
5
5
  particleInit(container: Container, particle: PathParticle): void;
6
6
  }
package/umd/PathDrawer.js CHANGED
@@ -13,7 +13,8 @@
13
13
  const engine_1 = require("@tsparticles/engine");
14
14
  const Utils_js_1 = require("./Utils.js");
15
15
  class PathDrawer {
16
- draw(context, particle, radius) {
16
+ draw(data) {
17
+ const { context, particle, radius } = data;
17
18
  if (!particle.pathData) {
18
19
  return;
19
20
  }