diff --git a/src/render.cpp b/src/render.cpp index 000279e..a896666 100644 --- a/src/render.cpp +++ b/src/render.cpp @@ -60,14 +60,15 @@ u32 mem_edit_bg_color_fn(const u8 *, u64 off, void *user_data) } if (rdata.rng_anchor_key.start <= off && off < rdata.rng_anchor_key.end()) return COL(app->vsettings.col_key); - if (rdata.rng_header.start - rblob_sz <= off && off <= rdata.rng_header.start) return COL(app->vsettings.col_key); - if (rdata.rng_footer.start - rblob_sz <= off && off <= rdata.rng_footer.start) return COL(app->vsettings.col_key); + if (rdata.rng_header.start - rblob_sz <= off && off < rdata.rng_header.start) return COL(app->vsettings.col_key); + if (rdata.rng_footer.start - rblob_sz <= off && off < rdata.rng_footer.start) return COL(app->vsettings.col_key); if (rdata.rng_anchor.start <= off && off < rdata.rng_anchor.end()) return COL(app->vsettings.col_anchor); if (rdata.rng_header.start <= off && off < rdata.rng_header.end()) return COL(app->vsettings.col_header); if (rdata.rng_footer.start <= off && off < rdata.rng_footer.end()) return COL(app->vsettings.col_footer); // Slow page group lookup, ideally only done once per render when last_pinfo is invalid. for (Page_Info_Chunk *chunk = rdata.page_chunks; chunk; chunk = chunk->next) { + if (chunk->range.start - rblob_sz <= off && off < chunk->range.start) return COL(app->vsettings.col_key); if (chunk->range.start <= off && off < chunk->range.end()) { for (u64 group_idx = chunk->first_group; group_idx < rdata.n_page_groups; ++group_idx) { const Page_Info_Group &group = rdata.page_groups[group_idx]; diff --git a/src/root/RMicroFileReader.cxx b/src/root/RMicroFileReader.cxx index 2f89068..9e92431 100644 --- a/src/root/RMicroFileReader.cxx +++ b/src/root/RMicroFileReader.cxx @@ -1177,7 +1177,12 @@ RMicroFileReader::GetNTupleProper(const char *ntupleName) fileInfo.anchor_key_nbytes = key.fKeyLen; fileInfo.anchor_seek = offset; fileInfo.anchor_nbytes = objNbytes; - fileInfo.rblob_key_header_nbytes = RTFKey{}.GetHeaderSize() + 3; + { + // @Incomplete: each section has a differently-sized RBlob, we need to account for that! + RTFKey dummy; + dummy.MakeBigKey(); + fileInfo.rblob_key_header_nbytes = dummy.GetHeaderSize(); + } fileInfo.tfile_header_nbytes = RTFHeader{}.GetSize(); // @---- ReadBuffer(ntuple, objNbytes, offset);