@tsparticles/engine 3.0.0-beta.5 → 3.0.1

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.
@@ -66,7 +66,7 @@
66
66
  if (colorStyles.stroke) {
67
67
  context.strokeStyle = colorStyles.stroke;
68
68
  }
69
- const drawData = { container, context, particle, radius, opacity, delta };
69
+ const drawData = { container, context, particle, radius, opacity, delta, transformData };
70
70
  context.beginPath();
71
71
  drawShape(drawData);
72
72
  if (particle.shapeClose) {
@@ -85,7 +85,7 @@
85
85
  }
86
86
  exports.drawParticle = drawParticle;
87
87
  function drawEffect(data) {
88
- const { container, context, particle, radius, opacity, delta } = data;
88
+ const { container, context, particle, radius, opacity, delta, transformData } = data;
89
89
  if (!particle.effect) {
90
90
  return;
91
91
  }
@@ -93,11 +93,19 @@
93
93
  if (!drawer) {
94
94
  return;
95
95
  }
96
- drawer.draw({ context, particle, radius, opacity, delta, pixelRatio: container.retina.pixelRatio });
96
+ drawer.draw({
97
+ context,
98
+ particle,
99
+ radius,
100
+ opacity,
101
+ delta,
102
+ pixelRatio: container.retina.pixelRatio,
103
+ transformData: { ...transformData },
104
+ });
97
105
  }
98
106
  exports.drawEffect = drawEffect;
99
107
  function drawShape(data) {
100
- const { container, context, particle, radius, opacity, delta } = data;
108
+ const { container, context, particle, radius, opacity, delta, transformData } = data;
101
109
  if (!particle.shape) {
102
110
  return;
103
111
  }
@@ -105,11 +113,19 @@
105
113
  if (!drawer) {
106
114
  return;
107
115
  }
108
- drawer.draw({ context, particle, radius, opacity, delta, pixelRatio: container.retina.pixelRatio });
116
+ drawer.draw({
117
+ context,
118
+ particle,
119
+ radius,
120
+ opacity,
121
+ delta,
122
+ pixelRatio: container.retina.pixelRatio,
123
+ transformData: { ...transformData },
124
+ });
109
125
  }
110
126
  exports.drawShape = drawShape;
111
127
  function drawShapeAfterDraw(data) {
112
- const { container, context, particle, radius, opacity, delta } = data;
128
+ const { container, context, particle, radius, opacity, delta, transformData } = data;
113
129
  if (!particle.shape) {
114
130
  return;
115
131
  }
@@ -117,7 +133,15 @@
117
133
  if (!drawer || !drawer.afterDraw) {
118
134
  return;
119
135
  }
120
- drawer.afterDraw({ context, particle, radius, opacity, delta, pixelRatio: container.retina.pixelRatio });
136
+ drawer.afterDraw({
137
+ context,
138
+ particle,
139
+ radius,
140
+ opacity,
141
+ delta,
142
+ pixelRatio: container.retina.pixelRatio,
143
+ transformData: { ...transformData },
144
+ });
121
145
  }
122
146
  exports.drawShapeAfterDraw = drawShapeAfterDraw;
123
147
  function drawPlugin(context, plugin, delta) {