Skip to content

Commit

Permalink
No rounding for more accurate positions
Browse files Browse the repository at this point in the history
  • Loading branch information
ccetl committed Apr 5, 2024
1 parent 70015d5 commit ad6542a
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions src/main/java/de/ccetl/jparticles/systems/ParticleSystem.java
Original file line number Diff line number Diff line change
Expand Up @@ -174,11 +174,6 @@ public void draw(double mouseX, double mouseY) {
}

private void drawTrails(ParticleElement dot, double alive, long time, boolean create) {
if (!options.isTrails()) {
return;
}


LinkedList<Trail> trail = dot.getTrail();

if (create) {
Expand Down Expand Up @@ -247,10 +242,10 @@ private void connectDots(ParticleElement dot) {
double correctedRotation = rotation - HALF_PI;
double correctedRotation1 = rotation + HALF_PI;

x = Math.round(vec.getX() + Math.cos(correctedRotation) * dot.getRadius());
y = Math.round(vec.getY() + Math.sin(correctedRotation) * dot.getRadius());
x1 = Math.round(vec1.getX() + Math.cos(correctedRotation1) * dot1.getRadius());
y1 = Math.round(vec1.getY() + Math.sin(correctedRotation1) * dot1.getRadius());
x = vec.getX() + Math.cos(correctedRotation) * dot.getRadius();
y = vec.getY() + Math.sin(correctedRotation) * dot.getRadius();
x1 = vec1.getX() + Math.cos(correctedRotation1) * dot1.getRadius();
y1 = vec1.getY() + Math.sin(correctedRotation1) * dot1.getRadius();
}

options.getRenderer().drawLine(x, y, x1, y1, options.getLineWidth(), dot.getColor());
Expand Down

0 comments on commit ad6542a

Please sign in to comment.