@tsparticles/shape-rounded-polygon 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.
- package/README.md +1 -1
- package/browser/RoundedPolygonDrawer.js +2 -1
- package/cjs/RoundedPolygonDrawer.js +2 -1
- package/esm/RoundedPolygonDrawer.js +2 -1
- package/package.json +4 -4
- package/report.html +23 -5
- package/tsparticles.shape.rounded-polygon.js +7 -2
- package/tsparticles.shape.rounded-polygon.min.js +1 -1
- package/tsparticles.shape.rounded-polygon.min.js.LICENSE.txt +1 -1
- package/types/RoundedPolygonDrawer.d.ts +3 -3
- package/umd/RoundedPolygonDrawer.js +2 -1
|
@@ -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.
|
|
7
|
+
* v3.0.0-beta.3
|
|
8
8
|
*/
|
|
9
9
|
(function webpackUniversalModuleDefinition(root, factory) {
|
|
10
10
|
if(typeof exports === 'object' && typeof module === 'object')
|
|
@@ -121,7 +121,12 @@ function roundedPath(context, path, radius) {
|
|
|
121
121
|
}
|
|
122
122
|
}
|
|
123
123
|
class RoundedPolygonDrawer {
|
|
124
|
-
draw(
|
|
124
|
+
draw(data) {
|
|
125
|
+
const {
|
|
126
|
+
context,
|
|
127
|
+
particle,
|
|
128
|
+
radius
|
|
129
|
+
} = data;
|
|
125
130
|
roundedPath(context, polygon(particle.sides, radius), particle.borderRadius ?? 5);
|
|
126
131
|
}
|
|
127
132
|
getSidesCount(particle) {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! For license information please see tsparticles.shape.rounded-polygon.min.js.LICENSE.txt */
|
|
2
|
-
!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 o="object"==typeof exports?t(require("@tsparticles/engine")):t(e.window);for(var r in o)("object"==typeof exports?exports:e)[r]=o[r]}}(this,(e=>(()=>{"use strict";var t={533:t=>{t.exports=e}},o={};function r(e){var n=o[e];if(void 0!==n)return n.exports;var a=o[e]={exports:{}};return t[e](a,a.exports,r),a.exports}r.d=(e,t)=>{for(var o in t)r.o(t,o)&&!r.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};return(()=>{r.r(n),r.d(n,{loadRoundedPolygonShape:()=>o});var e=r(533);class t{draw(e
|
|
2
|
+
!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 o="object"==typeof exports?t(require("@tsparticles/engine")):t(e.window);for(var r in o)("object"==typeof exports?exports:e)[r]=o[r]}}(this,(e=>(()=>{"use strict";var t={533:t=>{t.exports=e}},o={};function r(e){var n=o[e];if(void 0!==n)return n.exports;var a=o[e]={exports:{}};return t[e](a,a.exports,r),a.exports}r.d=(e,t)=>{for(var o in t)r.o(t,o)&&!r.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};return(()=>{r.r(n),r.d(n,{loadRoundedPolygonShape:()=>o});var e=r(533);class t{draw(e){const{context:t,particle:o,radius:r}=e;!function(e,t,o){let r=t[0],n=t[1];const a=t.length;e.moveTo((r.x+n.x)/2,(r.y+n.y)/2);for(let i=1;i<=a;i++)r=n,n=t[(i+1)%a],e.arcTo(r.x,r.y,(r.x+n.x)/2,(r.y+n.y)/2,o)}(t,function(e,t,o=0){const r=2*Math.PI/e,n=[];for(let a=0;a<e;a++)n.push({x:Math.cos(a*r+o)*t,y:Math.sin(a*r+o)*t});return n}(o.sides,r),o.borderRadius??5)}getSidesCount(t){const o=t.shapeData;return Math.round((0,e.getRangeValue)(o?.sides??5))}particleInit(t,o){const r=o.shapeData;o.borderRadius=Math.round((0,e.getRangeValue)(r?.radius??5))*t.retina.pixelRatio}}async function o(e,o=!0){await e.addShape("rounded-polygon",new t,o)}})(),n})()));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
/*! tsParticles RoundedPolygon Shape v3.0.0-beta.
|
|
1
|
+
/*! tsParticles RoundedPolygon Shape v3.0.0-beta.3 by Matteo Bruni */
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { type Container, type IShapeDrawer, type Particle } from "@tsparticles/engine";
|
|
1
|
+
import { type Container, type IShapeDrawData, type IShapeDrawer, type Particle } from "@tsparticles/engine";
|
|
2
2
|
import type { RoundedParticle } from "./RoundedParticle.js";
|
|
3
|
-
export declare class RoundedPolygonDrawer implements IShapeDrawer {
|
|
4
|
-
draw(
|
|
3
|
+
export declare class RoundedPolygonDrawer implements IShapeDrawer<RoundedParticle> {
|
|
4
|
+
draw(data: IShapeDrawData<RoundedParticle>): void;
|
|
5
5
|
getSidesCount(particle: Particle): number;
|
|
6
6
|
particleInit(container: Container, particle: RoundedParticle): void;
|
|
7
7
|
}
|
|
@@ -29,7 +29,8 @@
|
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
31
|
class RoundedPolygonDrawer {
|
|
32
|
-
draw(
|
|
32
|
+
draw(data) {
|
|
33
|
+
const { context, particle, radius } = data;
|
|
33
34
|
roundedPath(context, polygon(particle.sides, radius), particle.borderRadius ?? 5);
|
|
34
35
|
}
|
|
35
36
|
getSidesCount(particle) {
|