From b1d79b74514041a059b454a9f6fc3970773c0cb8 Mon Sep 17 00:00:00 2001
From: Normand Briere <nbriere@noware.ca>
Date: Mon, 12 Aug 2019 18:19:30 -0400
Subject: [PATCH] Compact toolbar.

---
 Torus.java |   56 ++++++++++++++++++++++++++++++++++++--------------------
 1 files changed, 36 insertions(+), 20 deletions(-)

diff --git a/Torus.java b/Torus.java
index af74364..dd1a181 100644
--- a/Torus.java
+++ b/Torus.java
@@ -2,6 +2,8 @@
 
 class Torus extends Biparam implements java.io.Serializable
 {
+        static final long serialVersionUID = -7637054329820073252L; // Old
+
     Torus()
     {
         inPnt = new cVector();
@@ -54,6 +56,11 @@
         buffer.append("}\n");
     }
 
+    double uStretch()
+    {
+        return 6; // Actually 6.28 (I think)
+    }
+    
     Vertex biparamFunction(double u, double v)
     {
         if (u == 1)
@@ -62,7 +69,7 @@
             v = 0;
         
         double uAng = u * 2 * Math.PI;
-        double vAng = v * 2 * Math.PI;
+        double vAng = -v * 2 * Math.PI;
         double cosua = Math.cos(uAng);
         double sinua = Math.sin(uAng);
         double cosva = Math.cos(vAng);
@@ -85,6 +92,9 @@
         //temp.pos = tPos; // useless new
         temp.norm = tNorm;
 		LA.vecNormalize(temp.norm);
+                
+        temp.y += minor;
+                
         return temp;
     }
 
@@ -116,55 +126,59 @@
         return rad2 <= minor * minor;
     }
 
-    void drawEditHandles(ClickInfo info, int level)
+    void drawEditHandles(//ClickInfo info,
+            int level)
     {
         if (level == 0)
         {
             return;
         } else
         {
-            super.drawEditHandles(info, level);
+            super.drawEditHandles(//info,
+                    level);
             cVector temp = LA.newVector(0, 0, minor);
             LA.xformPos(temp, toParent, temp);
-            Rectangle majorSpot = calcHotSpot(temp, info);
+            Rectangle majorSpot = calcHotSpot(temp); //, info);
             majorSpot.translate(4, 4);
             temp.x = major;
             temp.y = temp.z = 0;
             LA.xformPos(temp, toParent, temp);
-            Rectangle minorSpot = calcHotSpot(temp, info);
+            Rectangle minorSpot = calcHotSpot(temp); //, info);
             minorSpot.translate(4, 4);
-            info.g.setColor(Color.green);
-            info.g.fillRect(majorSpot.x, majorSpot.y, majorSpot.width, majorSpot.height);
-            info.g.fillRect(minorSpot.x, minorSpot.y, minorSpot.width, minorSpot.height);
+            clickInfo.g.setColor(Color.green);
+            clickInfo.g.fillRect(majorSpot.x, majorSpot.y, majorSpot.width, majorSpot.height);
+            clickInfo.g.fillRect(minorSpot.x, minorSpot.y, minorSpot.width, minorSpot.height);
             return;
         }
     }
 
-    boolean doEditClick(ClickInfo info, int level)
+    boolean doEditClick(//ClickInfo info,
+            int level)
     {
         if (level == 0)
             return false;
         hitSomething = 0;
-        if (super.doEditClick(info, level))
+        if (super.doEditClick(//info,
+                level))
         {
             hitSomething = 1;
             return true;
         }
         cVector temp = LA.newVector(0, 0, minor);
         LA.xformPos(temp, toParent, temp);
-        Rectangle majorSpot = calcHotSpot(temp, info);
+        Rectangle majorSpot = calcHotSpot(temp); //, info);
         majorSpot.translate(4, 4);
         temp.x = major;
         temp.y = temp.z = 0;
         LA.xformPos(temp, toParent, temp);
-        Rectangle minorSpot = calcHotSpot(temp, info);
+        Rectangle minorSpot = calcHotSpot(temp); //, info);
         minorSpot.translate(4, 4);
-        if (majorSpot.contains(info.x, info.y))
+        if (majorSpot.contains(clickInfo.x, clickInfo.y))
         {
             hitSomething = 2;
             startRad = major;
         } else
-        if (minorSpot.contains(info.x, info.y))
+        if (minorSpot.contains(clickInfo.x, clickInfo.y))
         {
             hitSomething = 3;
             startRad = minor;
@@ -172,23 +186,25 @@
         {
             return false;
         }
-        startX = info.x;
+        startX = clickInfo.x;
         return true;
     }
 
-    void doEditDrag(ClickInfo info)
+    void doEditDrag(//ClickInfo info,
+            boolean opposite)
     {
         if (hitSomething == 0)
             return;
         if (hitSomething == 1)
         {
-            super.doEditDrag(info);
+            super.doEditDrag(//info,
+                    opposite);
             return;
         }
-        double deltaR = info.x - startX;
+        double deltaR = clickInfo.x - startX;
         //cVector delta = LA.newVector(info.x - startX, 0, 0);
         //LA.xformDir(delta, info.camera.fromScreen, delta);
-		deltaR /= 100 * info.camera.SCALE / info.camera.Distance();
+		deltaR /= 100 * clickInfo.camera.SCALE / clickInfo.camera.Distance();
         double newRad = startRad + deltaR;
         if (newRad < 0)
             newRad = 0;
@@ -197,7 +213,7 @@
         else
             minor = newRad;
         recalculate();
-        info.pane.repaint();
+        clickInfo.pane.repaint();
     }
 
     double major;

--
Gitblit v1.6.2