52 |
} |
} |
53 |
|
|
54 |
static Rectangle box = new Rectangle(); |
static Rectangle box = new Rectangle(); |
55 |
public void place(Cell c, VobScene v, int cs, ViewContext context, float scale) { |
public void place(Cell c, VobScene v, int cs_out, int cs_box, float x, float y, float w, float h, ViewContext context, float scale) { |
56 |
String s = c.t(); |
String s = c.t(); |
57 |
if (s == null) s = ""; |
if (s == null) s = ""; |
58 |
int offs = context.getCursorOffset(c); |
int offs = context.getCursorOffset(c); |
77 |
float left = style.getWidth(s.substring(0, center), scale); |
float left = style.getWidth(s.substring(0, center), scale); |
78 |
float right = width - left; |
float right = width - left; |
79 |
|
|
80 |
v.coords.getRenderInfo(cs).getExtRect(box); |
float middle = w / 2.0f; |
|
float middle = box.width / 2.0f; |
|
81 |
|
|
82 |
float skew; |
float skew; |
83 |
if(width < box.width) skew = 0; |
if(width < w) skew = 0; |
84 |
else if(left < middle) skew = 0; |
else if(left < middle) skew = 0; |
85 |
else if(right < middle) skew = (- width + box.width); |
else if(right < middle) skew = (- width + w); |
86 |
else skew = (- left + middle); |
else skew = (- left + middle); |
87 |
|
|
88 |
Object key = (line < KEY.length) ? KEY[line] : new Integer(line+1); |
Object key = (line < KEY.length) ? KEY[line] : new Integer(line+1); |
89 |
int skewedcs = v.coordsys(cs, key, 0, skew, 0, width, box.height); |
// int skewedcs = v.coordsys(cs, key, 0, skew, 0, w, box.height); |
90 |
|
|
91 |
placeVob(c, v, skewedcs, brBefore, brAfter, offs, context, scale); |
placeVob(c, v, cs_box, brBefore, brAfter, offs, context, scale); |
92 |
} |
} |
93 |
|
|
94 |
protected void placeVob(Cell c, VobScene v, int cs, int start, int end, |
protected void placeVob(Cell c, VobScene v, int cs, int start, int end, |