gzz-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gzz-commits] libvob/org/nongnu/libvob/impl OrthoCoorder.java


From: Matti Katila
Subject: [Gzz-commits] libvob/org/nongnu/libvob/impl OrthoCoorder.java
Date: Mon, 07 Apr 2003 05:12:29 -0400

CVSROOT:        /cvsroot/libvob
Module name:    libvob
Changes by:     Matti Katila <address@hidden>   03/04/07 05:12:28

Modified files:
        org/nongnu/libvob/impl: OrthoCoorder.java 

Log message:
        buoy not done + clean

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/org/nongnu/libvob/impl/OrthoCoorder.java.diff?tr1=1.6&tr2=1.7&r1=text&r2=text

Patches:
Index: libvob/org/nongnu/libvob/impl/OrthoCoorder.java
diff -u libvob/org/nongnu/libvob/impl/OrthoCoorder.java:1.6 
libvob/org/nongnu/libvob/impl/OrthoCoorder.java:1.7
--- libvob/org/nongnu/libvob/impl/OrthoCoorder.java:1.6 Sat Apr  5 15:25:10 2003
+++ libvob/org/nongnu/libvob/impl/OrthoCoorder.java     Mon Apr  7 05:12:27 2003
@@ -35,7 +35,7 @@
  */
 
 public class OrthoCoorder extends VobCoorder {
-public static final String rcsid = "$Id: OrthoCoorder.java,v 1.6 2003/04/05 
20:25:10 mudyc Exp $";
+public static final String rcsid = "$Id: OrthoCoorder.java,v 1.7 2003/04/07 
09:12:27 mudyc Exp $";
     public static boolean dbg = false;
     private static void p(String s) { if(dbg) pa(s); }
     private static void pa(String s) { System.out.println("OrthoCoorder::"+s); 
}
@@ -154,34 +154,41 @@
        float x = xy[0] + size[0]/2;
        float y = xy[1] + size[1]/2;
 
-       //pa("anchor x/y: "+x+"/"+y);
-
+       // distance/legth from center to anchor
        len = (float)Math.sqrt( (x-cx)*(x-cx) + (y-cy)*(y-cy) );
 
-       //pa("len: "+len+", rad: "+rad);
-
        // if len is longer than rad - do nothing.
-       float wh = min;
        int cs = anchor;
-       if (len <= rad) { 
 
-           // project and translate buoy
+       // project and translate buoy
+       if (len <= rad) { 
 
            // angular coefficient
            float ac = 1;
            if (px-x != 0) // tan a = y/x
                ac = (py-y)/(px-x);
 
-           //cs = orthoBox(0, (len/rad)*100,cx + (float)Math.cos(ac)*rad/2,
-           cs = orthoBox(0, (len/rad)*99f,cx + (float)Math.cos(ac)*rad/2,
-                         cy + (float)Math.sin(ac)*rad, 1,1, 50,50 );
-           // box size not counted XXX XXX
-           
+           float boxSize = max - (max-min)*(len/rad);
+           if (px <= x) {
+               if (ac < 1 && ac >= -1)
+                   cs = orthoBox(0, (len/rad)*99f, // most close go up - 
others down.
+                                 cx + (float)Math.cos(ac)*rad, // x
+                                 cy + (float)Math.sin(ac)*rad, 1,1, 
boxSize,boxSize ); 
+               else 
+                   cs = orthoBox(0, (len/rad)*99f, // most close go up - 
others down.
+                                 cx - (float)Math.cos(ac)*rad, // x
+                                 cy + (float)Math.sin(ac)*rad, 1,1, 
boxSize,boxSize ); 
+           } else {
+               if (ac < 1 && ac >= -1)
+                   cs = orthoBox(0, (len/rad)*99f, // most close go up - 
others down.
+                                 cx - (float)Math.cos(ac)*rad, // x
+                                 cy + (float)Math.sin(ac)*rad, 1,1, 
boxSize,boxSize ); 
+               else 
+                   cs = orthoBox(0, (len/rad)*99f, // most close go up - 
others down.
+                                 cx + (float)Math.cos(ac)*rad, // x
+                                 cy + (float)Math.sin(ac)*rad, 1,1, 
boxSize,boxSize ); 
+           }
        }
-       // proper box
-       //cs = orthoBox(cs, 0, -wh/2, -wh/2, 1,1, wh,wh);
-
-       // XXX macthing?
        return cs;
    }
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]