236 |
|
|
237 |
float w = 0; |
float w = 0; |
238 |
|
|
239 |
|
if(dbg) p("getSelection: "+x+" "+y+" "+width+" "+height); |
240 |
|
|
241 |
// Go into page where selection starts |
// Go into page where selection starts |
242 |
for (int p = 0; p<pages.length; p++) { |
for (int p = 0; p<pages.length; p++) { |
243 |
// Vob coordinates of the intersecting rectangle |
// Vob coordinates of the intersecting rectangle |
249 |
sx1 = x + width - xywh[4*p] - w; |
sx1 = x + width - xywh[4*p] - w; |
250 |
sy1 = y + height - xywh[4*p + 1]; |
sy1 = y + height - xywh[4*p + 1]; |
251 |
|
|
252 |
|
if(dbg) p("Page "+p+": "+sx0+" "+sy0+" "+sx1+" "+sy1+" - "+ |
253 |
|
xywh[4*p+2]); |
254 |
|
|
255 |
w += xywh[4*p + 2]; |
w += xywh[4*p + 2]; |
256 |
|
|
257 |
int rx0, rx1, ry0, ry1; |
int rx0, rx1, ry0, ry1; |
261 |
rx1 = spivs[p].getSpanX(sx1); |
rx1 = spivs[p].getSpanX(sx1); |
262 |
ry1 = spivs[p].getSpanY(sy1); |
ry1 = spivs[p].getSpanY(sy1); |
263 |
|
|
264 |
|
if(dbg) p(": "+rx0+" "+ry0+" "+rx1+" "+ry1+" - "); |
265 |
|
|
266 |
if(rx0 < 0) rx0 = 0; |
if(rx0 < 0) rx0 = 0; |
267 |
if(ry0 < 0) ry0 = 0; |
if(ry0 < 0) ry0 = 0; |
268 |
|
|
275 |
if(rx1 >= d.width) rx1 = d.width - 1; |
if(rx1 >= d.width) rx1 = d.width - 1; |
276 |
if(ry1 >= d.height) ry1 = d.height - 1; |
if(ry1 >= d.height) ry1 = d.height - 1; |
277 |
|
|
278 |
|
if(dbg) p("final: "+rx0+" "+ry0+" "+rx1+" "+ry1+" - "); |
279 |
|
|
280 |
enf = enf.plus(enfilade1DMaker.makeEnfilade(pages[p].subArea(rx0,ry0, rx1-rx0, ry1-ry0))); |
enf = enf.plus(enfilade1DMaker.makeEnfilade(pages[p].subArea(rx0,ry0, rx1-rx0, ry1-ry0))); |
281 |
} |
} |
282 |
return enf; |
return enf; |