mirror of
https://github.com/storytold/pdfcraft.git
synced 2026-11-26 04:58:07 +00:00
lead: remove the red rounds' DIAG prints from product code
This commit is contained in:
@@ -695,7 +695,6 @@ impl PdfCraftApp {
|
||||
if blocked {
|
||||
let thread = std::thread::current();
|
||||
let name = thread.name().unwrap_or("").rsplit("::").next().unwrap_or("");
|
||||
eprintln!("DIAG {name}: input blocked: modal {} palette {} focused {}", self.modal_open(), self.palette_open, ctx.input(|i| i.focused));
|
||||
}
|
||||
for (index, view) in self.views.iter_mut().enumerate() {
|
||||
let shut = blocked || self.active != Some(index);
|
||||
|
||||
@@ -223,15 +223,6 @@ mod picture_tests {
|
||||
h.run_steps(2);
|
||||
let test = std::thread::current().name().and_then(|n| n.rsplit("::").next()).unwrap_or_default().to_owned();
|
||||
let s = h.state();
|
||||
eprintln!(
|
||||
"DIAG {test}: tool={:?} pending={:?} picked={:?} xform={} edit_gen={} point={:?}",
|
||||
s.quick_tool,
|
||||
s.views[0].session.pending_pick,
|
||||
s.views[0].session.picked_image.is_some(),
|
||||
s.views[0].page_xform(0).is_some(),
|
||||
s.session.get(s.views[0].id).map(|d| d.edit_generation()).unwrap_or_default(),
|
||||
at(100.0, 150.0)
|
||||
);
|
||||
assert!(h.state().views[0].session.pending_pick.is_some(), "the click waits for its page");
|
||||
}
|
||||
|
||||
|
||||
@@ -388,7 +388,6 @@ impl Component for PageParts<'_> {
|
||||
if press.phase.is_press() || hovered {
|
||||
let thread = std::thread::current();
|
||||
let name = thread.name().unwrap_or("").rsplit("::").next().unwrap_or("");
|
||||
eprintln!("DIAG {name}: part {:?} page {} hovered {hovered} phase {:?}", part.owner, part.page, press.phase);
|
||||
}
|
||||
if press.phase.is_press() && self.report.press.is_none() {
|
||||
self.report.press = Some(PagePress { owner: part.owner, page: part.page, phase: press.phase, mods: press.mods });
|
||||
|
||||
@@ -83,11 +83,6 @@ fn select_after_edit(
|
||||
view.session.comments.select_keys(&[(a.page, n)]);
|
||||
}
|
||||
view.session.comments.reveal = true;
|
||||
eprintln!(
|
||||
"DIAG a_shape_just_drawn_resizes_from_its_handles_without_the_select_tool: AddAnnotation {:?} newest {newest:?} selection {:?}",
|
||||
std::mem::discriminant(&a.shape),
|
||||
view.session.comments.selection()
|
||||
);
|
||||
// A new highlight opens its note for typing straight away, as in Acrobat,
|
||||
// unless a note typed into another card is still unsaved.
|
||||
if let (pdfcraft_engine::Shape::TextMarkup { kind: pdfcraft_engine::Markup::Highlight, .. }, Some(n)) = (&a.shape, newest)
|
||||
@@ -113,7 +108,6 @@ fn select_after_edit(
|
||||
// can be moved or copied again; anything else in a batch clears the selection.
|
||||
Edit::Batch { edits, .. } if edits.iter().all(|e| matches!(e, Edit::MoveAnnotation { .. })) => {}
|
||||
Edit::Batch { edits, .. } => {
|
||||
eprintln!("DIAG a_shape_just_drawn_resizes_from_its_handles_without_the_select_tool: batch of {} cleared the selection", edits.len());
|
||||
view.session.comments.clear_selection();
|
||||
}
|
||||
// The copies the paste added (and nothing that was there before): select them all.
|
||||
|
||||
@@ -722,7 +722,6 @@ fn build(old: &Old, right: Option<RightPanel>, widths: bool) -> Option<Workspace
|
||||
let apply = |workspace: &mut Workspace<PanelId>, action| workspace.apply(action, false, permissions).ok();
|
||||
if old.tools_right {
|
||||
let moved = workspace.apply(Action::move_column(PanelId::Tools, Target::new_dock(DockEdge::End)), false, permissions);
|
||||
eprintln!("DIAG an_old_saved_layout_migrates_to_the_dock_workspace: move tools right (widths {widths}): ok {}", moved.is_ok());
|
||||
moved.ok()?;
|
||||
}
|
||||
let side = right.filter(|_| old.side_open).map(PanelId::from);
|
||||
|
||||
@@ -436,7 +436,6 @@ pub(crate) fn page_area(app: &mut PdfCraftApp, ui: &mut egui::Ui) {
|
||||
let active = usize::from(app.active.and_then(|i| app.views.get(i)).is_some_and(|v| v.pane.place == Place::Second));
|
||||
// The drop rule reads the open views up front: the views closure below borrows the app.
|
||||
let open: HashSet<u64> = app.views.iter().map(|v| v.pane.key).collect();
|
||||
eprintln!("DIAG fit_visible_zooms_to_the_content_width: page_area avail {:?}", ui.available_rect_before_wrap());
|
||||
let views = SplitViews::new(tl!("Pages").to_string(), layout, Bind::bound(&mut at))
|
||||
.count(1)
|
||||
.active(active)
|
||||
@@ -449,7 +448,6 @@ pub(crate) fn page_area(app: &mut PdfCraftApp, ui: &mut egui::Ui) {
|
||||
strip(app, ui, place);
|
||||
}
|
||||
let room = ui.available_rect_before_wrap();
|
||||
eprintln!("DIAG fit_visible_zooms_to_the_content_width: pane {:?} room {room:?} max {:?}", pane.rect, ui.max_rect());
|
||||
let mut body_ui = ui.new_child(egui::UiBuilder::new().max_rect(room).id_salt("body"));
|
||||
body_ui.shrink_clip_rect(room);
|
||||
// The strip may have closed or moved a tab just now: look the pane's tab up again (a
|
||||
|
||||
@@ -426,12 +426,6 @@ pub(crate) fn field_press(
|
||||
let form = doc.form.as_slice();
|
||||
let Some((f, w)) = form.get(field).and_then(|f| f.widgets.get(wi).map(|w| (f, w))) else { return };
|
||||
let usable = usable(f, w, allowed);
|
||||
eprintln!(
|
||||
"DIAG list_box_clicks_select_directly_and_ctrl_click_toggles_multi: field_press {} widget {wi} usable {usable} down {} release_click {}",
|
||||
f.name,
|
||||
matches!(press.phase, PressPhase::Down { .. }),
|
||||
matches!(press.phase, PressPhase::Release { click: true, .. })
|
||||
);
|
||||
match &press.phase {
|
||||
PressPhase::Down { start, .. } => {
|
||||
// The press runs the widget's Mouse Down JavaScript, as in Acrobat (#269).
|
||||
|
||||
@@ -52,7 +52,6 @@ impl<'a> SignAreaTool<'a> {
|
||||
|
||||
impl CanvasTool for SignAreaTool<'_> {
|
||||
fn press(&mut self, pointer: &ToolPointer, _cx: &mut ToolContext<'_>) -> ToolAction {
|
||||
eprintln!("DIAG ctrl_alt_q_types_an_email_without_quitting: sign press at {:?}, placed {}", pointer.pos, self.placed.len());
|
||||
match self.placed_at(pointer.pos) {
|
||||
Some(placed) if self.drag.press(placed, pointer.pos) => ToolAction::Claimed,
|
||||
_ => ToolAction::Ignored,
|
||||
@@ -65,7 +64,6 @@ impl CanvasTool for SignAreaTool<'_> {
|
||||
|
||||
fn release(&mut self, pointer: &ToolPointer, _cx: &mut ToolContext<'_>) {
|
||||
self.drag.drag(pointer.pos);
|
||||
eprintln!("DIAG ctrl_alt_q_types_an_email_without_quitting: sign release at {:?}, active {}", pointer.pos, self.drag.is_active());
|
||||
// A click with no drag leaves nothing drawn: `release` gives none under the least side.
|
||||
let Some((page, rect)) = self.drag.release(LEAST_SIDE) else { return };
|
||||
let Some(placed) = self.placed.iter().find(|p| p.page == page) else { return };
|
||||
|
||||
@@ -482,11 +482,6 @@ mod tests {
|
||||
let ctx_h = h.ctx.clone();
|
||||
h.state_mut().reduce_file_size(&ctx_h);
|
||||
h.run_steps(2);
|
||||
eprintln!(
|
||||
"DIAG reduce_file_size_asks_where_to_save_before_it_compresses: run {} waiting {}",
|
||||
h.state().optimize_run.is_some(),
|
||||
jobs.waiting()
|
||||
);
|
||||
assert!(h.state().optimize_run.is_none() && jobs.waiting() == 0, "nothing runs until the answer is in");
|
||||
assert_eq!(files.open(), 1, "the question is out");
|
||||
assert!(files.file(&out).is_none(), "no copy is written before the answer");
|
||||
|
||||
Reference in New Issue
Block a user