From 25cef97465f0bfa8959663754e9243006324c81c Mon Sep 17 00:00:00 2001
From: Normand Briere <nbriere@noware.ca>
Date: Wed, 01 May 2019 10:09:53 -0400
Subject: [PATCH] Nimbus L&F

---
 CameraPane.java |   38 ++++++++++++++++++++++++++++----------
 1 files changed, 28 insertions(+), 10 deletions(-)

diff --git a/CameraPane.java b/CameraPane.java
index 8c8c173..f5d934c 100644
--- a/CameraPane.java
+++ b/CameraPane.java
@@ -86,12 +86,14 @@
 static    boolean FULLSCREEN = false;
 static    boolean SUPPORT = true;
 static    boolean INERTIA = true;
-static    boolean FAST = false;
+static    boolean FAST = true; // false;
 static    boolean SLOWPOSE = false;
 static    boolean FOOTCONTACT = true;
 
 static    int tickcount = 0; // slow pose issue
 
+static    boolean BUTTONLESSWHEEL = false;
+static    boolean ZOOMBOXMODE = false;
 static    boolean BOXMODE = false;
 static    boolean IMAGEFLIP = false;
 static    boolean SMOOTHFOCUS = false;
@@ -223,6 +225,11 @@
     public boolean IsBoxMode()
     {
             return BOXMODE;
+    }
+    
+    public boolean IsZoomBoxMode()
+    {
+            return ZOOMBOXMODE;
     }
     
     public void ClearDepth()
@@ -1612,12 +1619,12 @@
         //col.getColorComponents(ColorSpace.getInstance(ColorSpace.CS_LINEAR_RGB), CameraPane.modelParams0);
         if (!material.multiply)
         {
-            display.color = color;
+            display.color = material.color;
             display.saturation = material.modulation;
         }
         else
         {
-            display.color *= color*2;
+            display.color *= material.color*2;
             display.saturation *= material.modulation*2;
         }
             
@@ -2168,6 +2175,11 @@
     public void ToggleBoxMode()
     {
         BOXMODE ^= true;
+    }
+
+    public void ToggleZoomBoxMode()
+    {
+        ZOOMBOXMODE ^= true;
     }
 
     public void ToggleSmoothFocus()
@@ -4196,6 +4208,7 @@
     
     com.sun.opengl.util.texture.Texture CompressTexture2(String name)
     {
+                new Exception().printStackTrace();
         System.exit(0);
         com.sun.opengl.util.texture.Texture texture = null;
 
@@ -12735,7 +12748,7 @@
               "MUL final.y, fragment.texcoord[0].x, c256;" +
               "FLR final.x, final.y;" +
               "SUB final.y, final.y, final.x;" +
-              "MUL final.x, final.x, c256i;" +
+              //"MUL final.x, final.x, c256i;" +
               "MOV final.z, zero.x;" +
               "MOV final.a, one.w;":""
               ) +
@@ -12743,7 +12756,7 @@
               "MUL final.y, fragment.texcoord[0].y, c256;" +
               "FLR final.x, final.y;" +
               "SUB final.y, final.y, final.x;" +
-              "MUL final.x, final.x, c256i;" +
+              //"MUL final.x, final.x, c256i;" +
               "MOV final.z, zero.x;" +
               "MOV final.a, one.w;":""
               ) +
@@ -13523,6 +13536,7 @@
 	
         //System.err.println("Dtime = " + Dtime + "; units = " + e.getUnitsToScroll() + "; ratio (units/ms) = " + ratio);
             
+        if (BUTTONLESSWHEEL)
 	if (Math.abs(ratio) < 0.1 || Math.abs(Dtime) == 0) // < 30)
 	{
             return;
@@ -13531,7 +13545,7 @@
         boolean capsLocked = Toolkit.getDefaultToolkit().getLockingKeyState(KeyEvent.VK_CAPS_LOCK);
         
         // TIMER
-        if (!wheeltimer.isRunning() && e.getModifiersEx() == 0 && !capsLocked) // VR
+        if (ZOOMBOXMODE && !wheeltimer.isRunning() && e.getModifiersEx() == 0 && !capsLocked) // VR
         {
             keepboxmode = BOXMODE;
             keepsupport = SUPPORT;
@@ -13748,11 +13762,11 @@
     
     public void mouseDragged(MouseEvent e)
     {
+        //System.out.println("mouseDragged: " + e);
         if (isRenderer)
             movingcamera = true;
         //if (drawing)
         //return;
-        //System.out.println("mouseDragged: " + e);
         if ((e.getModifiersEx() & CTRL) != 0
             || (e.getModifiersEx() & COMMAND) != 0) // || IsFrozen())
         {
@@ -13933,6 +13947,7 @@
         
         public void run()
         {
+                new Exception().printStackTrace();
             System.exit(0);
             for (;;)
             {
@@ -14287,7 +14302,6 @@
     public void mouseMoved(MouseEvent e)
     {
         //System.out.println("mouseMoved: " + e);
-
         if (isRenderer)
             return;
         
@@ -15100,8 +15114,9 @@
 
     protected void processMouseMotionEvent(MouseEvent e)
     {
-        //System.out.println("processMouseMotionEvent: " + mouseMode);
-        if (e.getButton() == MouseEvent.NOBUTTON && (mouseMode & SELECT) == 0)
+        //System.out.println("processMouseMotionEvent: " + mouseMode + " " + e.getModifiers() + " " + e.getModifiersEx() + " " + e.getButton());
+        //if (e.getButton() == MouseEvent.NOBUTTON && (mouseMode & SELECT) == 0)
+        if ((e.getModifiers() & MouseEvent.BUTTON1_MASK) == 0 && (mouseMode & SELECT) == 0)
         {
             mouseMoved(e);
         } else
@@ -15131,6 +15146,7 @@
 
     void SelectParent()
     {
+                new Exception().printStackTrace();
         System.exit(0);
         Composite group = (Composite) object;
         java.util.Vector selectees = new java.util.Vector(group.selection);
@@ -15154,6 +15170,7 @@
 
     void SelectChildren()
     {
+                new Exception().printStackTrace();
         System.exit(0);
         /*
         Composite group = (Composite) object;
@@ -16267,6 +16284,7 @@
         {
             if (!selection)
             {
+                new Exception().printStackTrace();
                 System.exit(0);
                 return;
             }

--
Gitblit v1.6.2