hold debug 2

This commit is contained in:
skylartaylor
2026-11-25 01:55:53 +01:00
parent 64af0d9f38
commit 80a237fb5a
2 changed files with 11 additions and 0 deletions
+10
View File
@@ -96,6 +96,16 @@ pub fn show(app: &mut LightcraftApp, ui: &mut egui::Ui) {
}
});
ui.data_mut(|d| d.insert_temp(egui::Id::unique(AREA), scrolled.id));
if held.is_some() || ui.data(|d| d.get_temp::<bool>(egui::Id::unique("dbg-hold"))).unwrap_or(false) {
eprintln!(
"DBGSHOW pass={} held={held:?} start={start:?} final_offset={} content={} inner={} measuring={}",
ui.ctx().cumulative_pass_nr(),
scrolled.state.offset.y,
scrolled.content_size.y,
scrolled.inner_rect.height(),
ui.is_sizing_pass() || craft::ui::runtime::measure::active(ui.ctx())
);
}
});
}
@@ -346,6 +346,7 @@ fn hold_list_in_place(ui: &mut egui::Ui, top: f32) {
if on_box || typing {
return;
}
eprintln!("DBGGREW pass={pass} grew={grew} height={height} before={before} offset_data={:?}", ui.data(|d| d.get_temp::<f32>(egui::Id::unique("right-scroll-offset"))));
ui.data_mut(|d| d.insert_temp(egui::Id::unique(HOLD), (grew, pass)));
// (drawn again at once at the new offset, so the list never shows a frame out of place)
ui.ctx().request_discard("the Keyword List holds its place");