57 |
|
|
58 |
float [] tmpSize = new float[2]; |
float [] tmpSize = new float[2]; |
59 |
float [] tmpSqSize = new float[2]; |
float [] tmpSqSize = new float[2]; |
60 |
public int renderBuoy(VobScene vs, int into, Object linkId, |
public int renderBuoy(VobScene vs, int into, float w, float h, Object linkId, |
61 |
Object anchor, Object cachedSize) { |
Object anchor, Object cachedSize) { |
62 |
if (dbg) pa("renderBuoy"); |
if (dbg) pa("renderBuoy"); |
63 |
if(effigy != 0) { |
if(effigy != 0) { |
68 |
View2D.Anchor a = (View2D.Anchor)anchor; |
View2D.Anchor a = (View2D.Anchor)anchor; |
69 |
|
|
70 |
view2d.getSize(a.plane, tmpSize); |
view2d.getSize(a.plane, tmpSize); |
|
vs.coords.getSqSize(into, tmpSqSize); |
|
71 |
|
|
72 |
|
|
73 |
float scale1 = tmpSize[0] / tmpSqSize[0]; |
float scale1 = tmpSize[0] / w; |
74 |
float scale2 = tmpSize[1] / tmpSqSize[1]; |
float scale2 = tmpSize[1] / h; |
75 |
float scale = (scale1 < scale2 ? scale1 : scale2); |
float scale = (scale1 < scale2 ? scale1 : scale2); |
76 |
|
|
77 |
int box2paper = vs.coords.orthoBox(0, 0, 0, 0, |
int box2paper = vs.coords.orthoBox(0, 0, 0, 0, |
78 |
scale, scale, |
scale, scale, |
79 |
tmpSqSize[0], tmpSqSize[1]); |
w, h); |
80 |
vs.matcher.add(into, box2paper, "BOX2PAPER"); |
vs.matcher.add(into, box2paper, "BOX2PAPER"); |
81 |
|
|
82 |
view2d.render(vs, a.plane, into, into, box2paper); |
view2d.render(vs, a.plane, into, into, box2paper); |