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 <noreply@anthropic.com>
This commit is contained in:
Brandon Thomas
2026-10-14 13:11:36 -04:00
co-authored by Claude Opus 5.5
parent 8a56ce8340
commit edaef792e0
4 changed files with 14 additions and 4 deletions
+9 -1
View File
@@ -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)) {
+1 -1
View File
@@ -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<Hyperlink> {
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.
+2
View File
@@ -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()
},
+2 -2
View File
@@ -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<Hyperlink>| 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);