Fix perspective issue du to a division previously returning result to an integer and not to an float number + fix Pair.equals

This commit is contained in:
Quentin Legot 2021-04-07 15:55:04 +02:00
parent acc7e17482
commit 0402d49622
2 changed files with 2 additions and 2 deletions

View File

@ -50,7 +50,7 @@ public abstract class AbstractListener implements GLEventListener {
gl.glMatrixMode(GL2.GL_PROJECTION); gl.glMatrixMode(GL2.GL_PROJECTION);
gl.glLoadIdentity(); gl.glLoadIdentity();
glu.gluPerspective(60.0f, (float) width / height, 0.1f, 1000.0f); glu.gluPerspective(60.0f, ((float) width) / height, 0.1f, 1000.0f);
} }
public abstract void drawLSystem(GL2 gl, Element element); public abstract void drawLSystem(GL2 gl, Element element);

View File

@ -38,7 +38,7 @@ public class Pair<U, K> {
return false; return false;
} }
final Pair<?, ?> other = (Pair<?, ?>) obj; final Pair<?, ?> other = (Pair<?, ?>) obj;
return this.left.equals(other.getLeft()) && this.left.equals(other.getRight()); return this.left.equals(other.getLeft()) && this.right.equals(other.getRight());
} }
@Override @Override