Skip to content

PdfCraft: An open-source PDF reader and editor written by scratch in pure Rust

Merge main into fix/undo-in-open-text-editor

RiceDee08ec1db79bdd
diff --cc crates/ui-egui/src/edit_text_ui.rs
index d72931fa1,f67398d84..396c430a7
--- a/crates/ui-egui/src/edit_text_ui.rs
+++ b/crates/ui-egui/src/edit_text_ui.rs
@@@ -1581,9 -1560,9 +1588,10 @@@ fn editor_galley(ui: &egui::Ui, ed: &Li
/// The inline editor; returns the edit once the text is applied.
pub(crate) fn overlay(ctx: &egui::Context, view: &mut DocView, info: &DocInfo) -> Option<Edit> {
+ let view_id = view.id;
- // Clicks outside the document (the Format text panel) keep the paragraph open.
- let outside = ctx.input(|i| i.pointer.latest_pos()).is_some_and(|p| !view.viewport_rect().contains(p));
+ // Clicks outside the document (the Format text panel) keep the paragraph open. Where the
+ // click landed is `interact_pos`: `latest_pos` is gone on the frame a tap lifts.
+ let outside = ctx.input(|i| i.pointer.interact_pos()).is_some_and(|p| !view.viewport_rect().contains(p));
let page = view.line_editor.as_ref()?.page;
let xf = view.page_xform(page)?;
let hold = view.objects.hold_editor;