From 161f9b64c2afe5544345ac387c3511d1232e3524 Mon Sep 17 00:00:00 2001 From: Arthur <78031901+Arthur7770@users.noreply.github.com> Date: Mon, 1 Mar 2021 13:34:04 +0100 Subject: [PATCH] Scroll REALLY Fixed --- src/lsystem/screen/listener/JoglMouseListener.java | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/lsystem/screen/listener/JoglMouseListener.java b/src/lsystem/screen/listener/JoglMouseListener.java index f9888f1..ced2645 100644 --- a/src/lsystem/screen/listener/JoglMouseListener.java +++ b/src/lsystem/screen/listener/JoglMouseListener.java @@ -75,16 +75,12 @@ public class JoglMouseListener implements MouseListener, MouseMotionListener, Mo @Override public void mouseWheelMoved(MouseWheelEvent e) { - if( 45 > Math.abs(canvas.camera[3])) - canvas.camera[0] += e.getWheelRotation()*Math.tan(Math.toRadians(-canvas.camera[3]))*0.25; + if( 45 > Math.abs(canvas.camera[3]) && 45>Math.abs(canvas.camera[4])) + canvas.camera[0] += e.getWheelRotation() * Math.tan(Math.toRadians(-canvas.camera[3])) * 0.25; else - canvas.camera[0] += e.getWheelRotation()*Math.tan(Math.toRadians(canvas.camera[3]))*0.25; - if(45>Math.abs(canvas.camera[4])) - canvas.camera[1] += e.getWheelRotation()*Math.tan(Math.toRadians(canvas.camera[4]))*0.25; - else - canvas.camera[1] += e.getWheelRotation()*Math.tan(Math.toRadians(-canvas.camera[4]))*0.25; - - if( 45 < Math.abs(canvas.camera[3]) || 45