180 |
*/ |
*/ |
181 |
static public Cell getCellAndOffset(VobScene vs, float x, float y, int[] offsOut) { |
static public Cell getCellAndOffset(VobScene vs, float x, float y, int[] offsOut) { |
182 |
float[] ic = new float[2]; |
float[] ic = new float[2]; |
183 |
Object k = vs.coords.getKeyAt(vs.map, x, y, ic); |
Object k = vs.getKeyAt(x, y, ic); |
184 |
if(k == null || !(k instanceof Cell)) { |
if(k == null || !(k instanceof Cell)) { |
185 |
pa("Clicked object not cell -- return null "+k); |
pa("Clicked object not cell -- return null "+k); |
186 |
return null; |
return null; |
224 |
BgVob bg = BgVob.create(plane); |
BgVob bg = BgVob.create(plane); |
225 |
|
|
226 |
// Coordinate system 1: the viewport |
// Coordinate system 1: the viewport |
227 |
int cs1_bg = into.coords.coordsys(0, keys.portBgKey, d+1, x, y, w, h); |
int cs1_bg = into.coords.coordsys(0, d+1, x, y, w, h); |
228 |
int cs1 = into.coords.coordsys(0, keys.portKey, d, x, y, w, h); |
into.matcher.add(cs1_bg, keys.portBgKey); |
229 |
|
int cs1 = into.coords.coordsys(0, d, x, y, w, h); |
230 |
|
into.matcher.add(cs1, keys.portKey); |
231 |
|
|
232 |
// Coordinate system 2: internals. |
// Coordinate system 2: internals. |
233 |
// 1) the x and y coordinates in real screen space corresponding to panx, pany |
// 1) the x and y coordinates in real screen space corresponding to panx, pany |
238 |
xorig -= panx * zoom / 1000.0f; |
xorig -= panx * zoom / 1000.0f; |
239 |
yorig -= pany * zoom / 1000.0f; |
yorig -= pany * zoom / 1000.0f; |
240 |
|
|
241 |
int cs2 = into.coords.coordsys(0, keys.coordKey, 10000, |
int cs2 = into.coords.coordsys(0, 10000, |
242 |
xorig-zoom/1000.0f, yorig-zoom/1000.0f, |
xorig-zoom/1000.0f, yorig-zoom/1000.0f, |
243 |
2*zoom/1000.0f, 2*zoom/1000.0f); |
2*zoom/1000.0f, 2*zoom/1000.0f); |
244 |
|
into.matcher.add(cs2, keys.coordKey); |
245 |
|
|
246 |
VobScene subvs = getPaperScene(into, cursor, leftBuoys, rightBuoys); |
VobScene subvs = getPaperScene(into, cursor, leftBuoys, rightBuoys); |
247 |
keys.setVobScene(subvs); |
keys.setVobScene(subvs); |