From c680a1b5c355d0263489323e35ebf723807ba145 Mon Sep 17 00:00:00 2001 From: silverweed Date: Tue, 30 Jul 2024 10:47:13 +0200 Subject: [PATCH] fix tfile header len --- src/render.cpp | 4 +++- src/rntuple.cpp | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/render.cpp b/src/render.cpp index d72017a..0eb452a 100644 --- a/src/render.cpp +++ b/src/render.cpp @@ -256,7 +256,9 @@ void update_and_render(Arena *arena, App_State &app, f32 delta_time_ms) ImGui::ColorEdit3("_Page List", app.viewer.col_section[Sec_Page_List], flags); ImGui::SameLine(); - if (ImGui::Button("Page List")) viewer_jump_to_page_list(app, app.viewer.latest_page_list_gone_to); + if (ImGui::Button("Page List")) + viewer_jump_to_page_list(app, app.viewer.latest_page_list_gone_to); + ImGui::SameLine(); { i64 page_list_to_go_to = app.viewer.latest_page_list_gone_to; diff --git a/src/rntuple.cpp b/src/rntuple.cpp index ad323db..bbf7645 100644 --- a/src/rntuple.cpp +++ b/src/rntuple.cpp @@ -376,7 +376,7 @@ Section find_section(App_State &app, u64 off, i64 hilite_cluster = -1) // TFile starting sections u64 root_header_padding = tdata.rng_root_file_obj.start - tdata.root_file_header_size; if (off < tdata.rng_root_file_obj.start) - return { Sec_TFile_Header, { 0, tdata.root_file_header_size }, 0, root_header_padding, hilite }; + return { Sec_TFile_Header, { 0, tdata.root_file_header_size + root_header_padding }, 0, root_header_padding, hilite }; if (tdata.rng_root_file_obj.start <= off && off < tdata.rng_root_file_obj.end()) return { Sec_TFile_Object, tdata.rng_root_file_obj, 0, 0, hilite }; @@ -386,7 +386,7 @@ Section find_section(App_State &app, u64 off, i64 hilite_cluster = -1) return { Sec_TFile_Info, tdata.rng_root_file_info, tdata.rng_root_file_info_header.len, 0, hilite }; if (tdata.rng_root_file_free_header.start <= off && off < tdata.rng_root_file_free.end()) { - printf("%lu\n", tdata.rng_root_file_free_header.len); + // printf("%lu\n", tdata.rng_root_file_free_header.len); return { Sec_TFile_FreeList, tdata.rng_root_file_free, tdata.rng_root_file_free_header.len, 0, hilite }; }