From 6f7ef0a33c4e870a4519d5c7948dd633c42007a2 Mon Sep 17 00:00:00 2001 From: Quentin Legot Date: Tue, 30 Mar 2021 17:37:40 +0200 Subject: [PATCH] Fix button gif not disappear --- src/lsystem/screen/gl3d/DrawHelper.java | 11 ++++++----- src/lsystem/screen/main/Listener.java | 4 ++-- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/lsystem/screen/gl3d/DrawHelper.java b/src/lsystem/screen/gl3d/DrawHelper.java index fa22d94..71c1bc0 100644 --- a/src/lsystem/screen/gl3d/DrawHelper.java +++ b/src/lsystem/screen/gl3d/DrawHelper.java @@ -27,12 +27,13 @@ public class DrawHelper { gl.glVertex3f(0f, 0f, 1f); gl.glColor3f(255f, 255f, 255f); - for (int i = -20; i < 21; i++) { - gl.glVertex3f(-20f, 0f, i); - gl.glVertex3f(20f, 0f, i); + int limit = 20; + for (int i = -limit; i < limit + 1; i++) { + gl.glVertex3f(-limit, 0f, i); + gl.glVertex3f(limit, 0f, i); - gl.glVertex3f(i, 0, -20f); - gl.glVertex3f(i, 0, 20f); + gl.glVertex3f(i, 0, -limit); + gl.glVertex3f(i, 0, limit); } gl.glEnd(); gl.glRasterPos3f(1.1f, 0.0f, 0.0f); diff --git a/src/lsystem/screen/main/Listener.java b/src/lsystem/screen/main/Listener.java index ec17441..9b02dc6 100644 --- a/src/lsystem/screen/main/Listener.java +++ b/src/lsystem/screen/main/Listener.java @@ -106,8 +106,8 @@ public class Listener implements ActionListener, KeyListener, MouseWheelListener } else if (!parser3D.isCorrect()) { openDialog("Vos règles ou votre axiome ne sont pas correctement écrites, veuillez recommencer"); } else { - tab.submitButton2D.setIcon(staticIcon); - tab.submitButton2D.setText(""); + tab.submitButton3D.setIcon(staticIcon); + tab.submitButton3D.setText(""); parserThread = new Thread(() -> { try { List> lSystemRules = parser3D.parseRules();