/[libvob]/libvob/org/nongnu/libvob/impl/OrthoCoorder.java
ViewVC logotype

Diff of /libvob/org/nongnu/libvob/impl/OrthoCoorder.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.12 by tjl, Wed Apr 23 16:46:02 2003 UTC revision 1.13 by tjl, Wed Apr 23 16:50:51 2003 UTC
# Line 86  public static final String rcsid = "$Id$ Line 86  public static final String rcsid = "$Id$
86          setInterpInfo(cs, this, cs, 0, xoffs, yoffs, xscale, yscale, info);          setInterpInfo(cs, this, cs, 0, xoffs, yoffs, xscale, yscale, info);
87      }      }
88    
89        static float[] rect = new float[4];
90      public boolean contains(int cs, float px, float py, float[] internalcoords) {      public boolean contains(int cs, float px, float py, float[] internalcoords) {
91              float x=sys.cx(cs), y=sys.cy(cs),              rect[0] = 0;
92                      w=sys.cw(cs)*sys.w[cs],              rect[1] = 0;
93                      h=sys.ch(cs)*sys.h[cs];              rect[2] = sys.w[cs];
94                rect[3] = sys.h[cs];
95    
96              if(dbg) pa("contains x: "+x+", y: "+y+", w: "+w+", h: "+h);              sys.transformRect(cs, rect);
97    
98              if(px >= x && py >= y &&              if(px >= rect[0] && py >= rect[1] &&
99                  px < x + w && py < y + h) {                  px < rect[0] + rect[2] && py < rect[1] + rect[3]) {
100                  if(internalcoords != null) {                  if(internalcoords != null) {
101                      internalcoords[0] = (px-x-w/2)/(w/2.0f);                      internalcoords[0] = (px-rect[0])/(rect[2]);
102                      internalcoords[1] = (py-y-h/2)/(h/2.0f);                      internalcoords[1] = (py-rect[1])/(rect[3]);
103                  }                  }
104                  return true;                  return true;
105              }              }

Legend:
Removed from v.1.12  
changed lines
  Added in v.1.13

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26