/[fenfire]/fenfire/org/fenfire/view/buoy/NodeType2D.java
ViewVC logotype

Diff of /fenfire/org/fenfire/view/buoy/NodeType2D.java

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

revision 1.13 by tjl, Wed Jul 30 12:47:43 2003 UTC revision 1.14 by tjl, Wed Jul 30 12:52:33 2003 UTC
# Line 60  public class NodeType2D extends Abstract Line 60  public class NodeType2D extends Abstract
60      }      }
61    
62      public int renderBuoy(VobScene vs, int into, Object linkId,      public int renderBuoy(VobScene vs, int into, Object linkId,
63                            Object anchor, Object cachedSize) {                            Object a, Object cachedSize) {
64          if (dbg) pa("start renderBuoy");          if (dbg) pa("start renderBuoy");
65          if(effigy != 0) {          if(effigy != 0) {
66              Vob eff = org.nongnu.libvob.gl.GLRen.createQuad(effigy-1, 0,0);              Vob eff = org.nongnu.libvob.gl.GLRen.createQuad(effigy-1, 0,0);
67              vs.map.put( eff, into);              vs.map.put( eff, into);
68              return into;              return into;
69          }          }
70          Triple t = (Triple)anchor;          View2D.Anchor anchor = (View2D.Anchor)a;
         Object plane = t.first;  
71    
         Rectangle rect = (Rectangle)t.second;  
         Object node = t.third; // may be null if this  
                                 // is not a noded View2D  
           
72          float[] tmp = new float[2];          float[] tmp = new float[2];
73          vs.coords.getSqSize(into, tmp);          vs.coords.getSqSize(into, tmp);
74          float w = tmp[0], h = tmp[1];          float w = tmp[0], h = tmp[1];
75          if (dbg) pa("rect "+rect+" coords "+w+","+h);          if (dbg) pa("rect "+anchor+" coords "+w+","+h);
76    
77          float scale = w / rect.width;          float scale = w / anchor.w;
78          if(scale < h / rect.height) scale = h / rect.height;          if(scale < h / anchor.h) scale = h / anchor.h;
79    
80          int box2paper = vs.coords.orthoBox(0, 0, rect.x, rect.y,          int box2paper = vs.coords.orthoBox(0, 0, anchor.x, anchor.y,
81                                             1/scale, 1/scale,                                             1/scale, 1/scale,
82                                             w, h);                                             w, h);
83  //      int box2paper = vs.coords.orthoBox(0, 0, 0, 0,  //      int box2paper = vs.coords.orthoBox(0, 0, 0, 0,
# Line 90  public class NodeType2D extends Abstract Line 85  public class NodeType2D extends Abstract
85  //                                         w, h);  //                                         w, h);
86          vs.matcher.add(into, box2paper, "BOX2PAPER");          vs.matcher.add(into, box2paper, "BOX2PAPER");
87    
88          view2d.render(vs, plane, into, into, box2paper);          view2d.render(vs, anchor.plane, into, into, box2paper);
89    
90          if (dbg) pa("start renderBuoy..DONE");          if (dbg) pa("start renderBuoy..DONE");
91    
92            // anchor.node may be null if this
93            // is not a noded View2D
94                    
95          int box = node==null ? into : vs.matcher.getCS(into, new Pair(plane, node));          int box = anchor.node==null
96                        ?  into
97                        : vs.matcher.getCS(into,
98                                new Pair(anchor.plane, anchor.node));
99          return vs.coords.unitSq(box);          return vs.coords.unitSq(box);
100      }      }
101  }  }

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

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