Skip to content

Commit

Permalink
fix: particles could result misplaced at the beginning, this is now f…
Browse files Browse the repository at this point in the history
…ixed
  • Loading branch information
matteobruni committed Apr 9, 2021
1 parent 15456f4 commit eae0937
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions core/main/src/Core/Canvas.ts
Expand Up @@ -171,7 +171,7 @@ export class Canvas {

const container = this.container;

container.canvas.resize();
this.resize();
container.actualOptions.setResponsive(this.size.width, container.retina.pixelRatio, container.options);

/* density particles enabled */
Expand Down Expand Up @@ -206,10 +206,12 @@ export class Canvas {
this.element.width = size.width;
this.element.height = size.height;

this.resizeFactor = {
width: size.width / oldSize.width,
height: size.height / oldSize.height,
};
if (this.container.started) {
this.resizeFactor = {
width: size.width / oldSize.width,
height: size.height / oldSize.height,
};
}
}

drawConnectLine(p1: IParticle, p2: IParticle): void {
Expand Down

0 comments on commit eae0937

Please sign in to comment.