get image dimension without loading the image

This commit is contained in:
honfika@gmail.com
2015-07-20 15:54:40 +02:00
parent 37dc877b16
commit ecc0cd3f15
10 changed files with 122 additions and 15 deletions

View File

@@ -408,17 +408,18 @@ public class DecompiledEditorPane extends LineMarkedEditorPane implements CaretL
int bi = abc.findBodyIndex(mi);
Highlighting h = Highlighting.searchPos(highlights, pos);
if (h != null) {
long highlightOffset = h.getProperties().offset;
List<AVM2Instruction> list = abc.bodies.get(bi).getCode().code;
AVM2Instruction lastIns = null;
long inspos = 0;
AVM2Instruction selIns = null;
for (AVM2Instruction ins : list) {
if (h.getProperties().offset == ins.getOffset()) {
if (highlightOffset == ins.getOffset()) {
selIns = ins;
break;
}
if (ins.getOffset() > h.getProperties().offset) {
inspos = h.getProperties().offset - lastIns.offset;
if (ins.getOffset() > highlightOffset) {
inspos = highlightOffset - lastIns.offset;
selIns = lastIns;
break;
}