highlight current node in dump view

This commit is contained in:
honfika
2014-06-22 19:31:26 +02:00
parent ebd0dea4a8
commit ab772df380
2 changed files with 127 additions and 31 deletions

View File

@@ -364,7 +364,11 @@ public class SWFInputStream implements AutoCloseable {
private void newDumpLevel(String name, String type) {
if (dumpInfo != null) {
DumpInfo di = new DumpInfo(name, type, null, is.getPos(), bitPos, 0, 0);
long startByte = is.getPos();
if (bitPos > 0) {
startByte--;
}
DumpInfo di = new DumpInfo(name, type, null, startByte, bitPos, 0, 0);
di.parent = dumpInfo;
dumpInfo.childInfos.add(di);
dumpInfo = di;
@@ -380,7 +384,7 @@ public class SWFInputStream implements AutoCloseable {
if (dumpInfo.startBit == 0 && bitPos == 0) {
dumpInfo.lengthBytes = is.getPos() - dumpInfo.startByte;
} else {
dumpInfo.lengthBits = (int) ((is.getPos() - dumpInfo.startByte - (dumpInfo.startBit == 0 ? 1 : 0)) * 8 - dumpInfo.startBit + bitPos);
dumpInfo.lengthBits = (int) ((is.getPos() - dumpInfo.startByte - 1) * 8 - dumpInfo.startBit + (bitPos == 0 ? 8 : bitPos));
}
dumpInfo.previewValue = value;
dumpInfo = dumpInfo.parent;