123 |
int offs, ViewContext context, float scale) { |
int offs, ViewContext context, float scale) { |
124 |
// XXX should optimize for common case: no substring() |
// XXX should optimize for common case: no substring() |
125 |
TextVob vob = new TextVob(style, c.t().substring(start, end)); |
TextVob vob = new TextVob(style, c.t().substring(start, end)); |
126 |
int cs_scaled = vs.orthoCS(cs, WH_KEY, 0, 0, 0, h, h); |
float scaled_h = vob.getHeight(scale) + vob.getDepth(scale); |
127 |
|
int cs_scaled = vs.orthoCS(cs, WH_KEY, 0, 0, 0, scaled_h, scaled_h); |
128 |
vs.map.put(vob, cs_scaled); |
vs.map.put(vob, cs_scaled); |
129 |
|
|
130 |
if(offs >= 0 && offs >= start && offs <= end) { |
if(offs >= 0 && offs >= start && offs <= end) { |
131 |
float x = style.getWidth(c.t().substring(start, offs), 1); |
float x = style.getWidth(c.t().substring(start, offs), 1); |
132 |
int cs_cursor = vs.orthoCS(cs, CURS_KEY, -1, x+1, 0, 0,h); |
int cs_cursor = vs.orthoCS(cs, CURS_KEY, -1, x+1, 0, 0,scaled_h); |
133 |
// v.map.put(new TextCursorVob(vob, offs), cs); |
// v.map.put(new TextCursorVob(vob, offs), cs); |
134 |
vs.map.put(cursorVob, cs_cursor); |
vs.map.put(cursorVob, cs_cursor); |
135 |
} |
} |