Skip to content

Commit

Permalink
feat: Some upgrades and fixes
Browse files Browse the repository at this point in the history
feat: Some upgrades and fixes
  • Loading branch information
drawcall committed Dec 10, 2023
1 parent 83c3caa commit 9281963
Show file tree
Hide file tree
Showing 7 changed files with 119 additions and 110 deletions.
204 changes: 104 additions & 100 deletions build/proton.js

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions build/proton.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion build/proton.min.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "proton-engine",
"version": "5.4.5",
"version": "6.0.1",
"description": "Proton is a simple and powerful javascript particle animation engine.",
"keywords": [
"particle",
Expand All @@ -23,7 +23,7 @@
"url": "https://github.com/drawcall/Proton.git"
},
"authors": [
"anonymous namespace <colorbuffer@gmail.com>"
"drawcall <colorbuffer@gmail.com>"
],
"license": "MIT",
"bugs": {
Expand Down
7 changes: 5 additions & 2 deletions src/emitter/Emitter.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ export default class Emitter extends Particle {
} else if (!isNaN(life)) {
this.life = life;
}

this.rate.init();
}

Expand Down Expand Up @@ -244,7 +243,11 @@ export default class Emitter extends Particle {
}

emitting(time) {
if (this.totalTime === "once") {
if (this.stoped) return;

if (this.totalTime === "none") {
this.emitTime += time;
} else if (this.totalTime === "once") {
let i;
const length = this.rate.getValue(99999);

Expand Down
4 changes: 2 additions & 2 deletions src/render/EaselRenderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export default class EaselRenderer extends BaseRenderer {
}

createCircle(particle) {
const graphics = this.pool.get(createjs.Graphics);
const graphics = this.pool.get(window.createjs.Graphics);

if (this.stroke) {
if (Types.isString(this.stroke)) {
Expand All @@ -62,7 +62,7 @@ export default class EaselRenderer extends BaseRenderer {
}
}
graphics.beginFill(particle.color || "#ff0000").drawCircle(0, 0, particle.radius);
const shape = this.pool.get(createjs.Shape, [graphics]);
const shape = this.pool.get(window.createjs.Shape, [graphics]);

particle.body = shape;
particle.graphics = graphics;
Expand Down
2 changes: 2 additions & 0 deletions src/utils/PropUtil.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import Span from "../math/Span";

export default {
hasProp(target, key) {
if (!target) return false;
Expand Down

0 comments on commit 9281963

Please sign in to comment.