From edaef792e048ef5c8cf9fc4b0c2ee82ca8bb6cc7 Mon Sep 17 00:00:00 2001 From: Brandon Thomas Date: Wed, 14 Oct 2026 13:11:36 -0400 Subject: [PATCH] Fix up merged PRs: Edit Points hits select their shape on right click; Hyperlink sound fields in #713's tests Co-Authored-By: Claude Opus 5.5 --- crates/engine/src/tools.rs | 10 +++++++++- crates/engine/tests/show_clicks.rs | 2 +- crates/pptx/tests/corpus.rs | 2 ++ crates/render/src/tests.rs | 4 ++-- 4 files changed, 14 insertions(+), 4 deletions(-) diff --git a/crates/engine/src/tools.rs b/crates/engine/src/tools.rs index 226f372a..feb7d641 100644 --- a/crates/engine/src/tools.rs +++ b/crates/engine/src/tools.rs @@ -972,7 +972,15 @@ impl Session { } let hit = self.hit_test(p, tol); let id = match &hit { - Some(Hit::Shape { id, .. } | Hit::Resize { id, .. } | Hit::Rotate { id } | Hit::Adjust { id, .. } | Hit::LineEnd { id, .. }) => Some(*id), + Some( + Hit::Shape { id, .. } + | Hit::Resize { id, .. } + | Hit::Rotate { id } + | Hit::Adjust { id, .. } + | Hit::LineEnd { id, .. } + | Hit::Handle { id, .. } + | Hit::Vertex { id, .. }, + ) => Some(*id), None => None, }; if !id.is_some_and(|id| st.selection.shapes.contains(&id)) { diff --git a/crates/engine/tests/show_clicks.rs b/crates/engine/tests/show_clicks.rs index 6fa7d1a0..bc7b93b8 100644 --- a/crates/engine/tests/show_clicks.rs +++ b/crates/engine/tests/show_clicks.rs @@ -20,7 +20,7 @@ fn shape(p: &mut Presentation, name: &str, text: &str, x: f64, y: f64, w: f64, h } fn link_to(slide: SlideId) -> Option { - Some(Hyperlink { action: Action::Slide { slide }, tooltip: String::new(), highlight_click: false }) + Some(Hyperlink { action: Action::Slide { slide }, tooltip: String::new(), highlight_click: false, sound: None, stop_sound: false }) } /// Clicking `trigger` makes `target` disappear. diff --git a/crates/pptx/tests/corpus.rs b/crates/pptx/tests/corpus.rs index 1f14f6ee..c37b3555 100644 --- a/crates/pptx/tests/corpus.rs +++ b/crates/pptx/tests/corpus.rs @@ -62,6 +62,8 @@ fn talk() -> Presentation { action: Action::Url { url: "https://example.org/north?q=1&x=2".into() }, tooltip: "Open the report".into(), highlight_click: false, + sound: None, + stop_sound: false, }), ..Default::default() }, diff --git a/crates/render/src/tests.rs b/crates/render/src/tests.rs index 7eedf64c..de42531a 100644 --- a/crates/render/src/tests.rs +++ b/crates/render/src/tests.rs @@ -1743,7 +1743,7 @@ fn east_asian_vertical_text_stands_ideographs_upright() { #[test] fn placed_shapes_give_the_click_boxes_of_a_slide_in_drawing_order() { use deckcraft_model::text::{Action, Hyperlink}; - let link = Hyperlink { action: Action::NextSlide, tooltip: String::new(), highlight_click: false }; + let link = Hyperlink { action: Action::NextSlide, tooltip: String::new(), highlight_click: false, sound: None, stop_sound: false }; let rect = |id: u32, x: f64, click: Option| Shape { id: ShapeId(id), xfrm: Some(Xfrm::new(x, 50.0, 100.0, 40.0)), @@ -1783,7 +1783,7 @@ fn a_text_hyperlink_belongs_to_the_shape_that_holds_the_text() { use deckcraft_model::text::{Action, Hyperlink}; let mut body = TextBody::from_text("click here"); for r in &mut body.paragraphs[0].runs { - r.props.link = Some(Hyperlink { action: Action::FirstSlide, tooltip: String::new(), highlight_click: false }); + r.props.link = Some(Hyperlink { action: Action::FirstSlide, tooltip: String::new(), highlight_click: false, sound: None, stop_sound: false }); } let sh = Shape { id: ShapeId(7), xfrm: Some(Xfrm::new(100.0, 100.0, 300.0, 60.0)), text: Some(body), ..Default::default() }; let placed = place_slide(&deck_with(vec![sh]), 0);