Skip to content

Commit 2b9b83e

Browse files
committed
Merge #1308: Edit Points: Shift, Ctrl or Alt while dragging a handle makes the point smooth, straight or corner
2 parents aaaee73 + ba59df7 commit 2b9b83e

9 files changed

Lines changed: 245 additions & 20 deletions

File tree

‎ROADMAP.md‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
**Stage: alpha** · next: beta, ~20 points and ~120–210 h away
44

5-
> **Last reviewed:** 2026-10-14 · **Last updated:** 2026-10-23 · **Change:** trivial (progress log: scroll bars on the zoomed slide pane, #1157; previous: minor, native chart payloads stored in bounded ZIP members; previous: major, community PR wave 2026-10-14: ~60 landed items in the progress log, among them the Font, Paragraph, Photo Album, theme colour and font and Date and Time dialogs, presenter and show controls, the SmartArt Text Pane and PPTX corpus slices; breadth 84% after `cargo xtask parity`, ready stays ~55%, stage stays alpha; duplicated rows and headers folded; previous: minor, hours to ~95% per audience added) · **Target:** Microsoft PowerPoint for Mac 16.113 (Microsoft 365)
5+
> **Last reviewed:** 2026-10-14 · **Last updated:** 2026-10-24 · **Change:** trivial (progress log: Edit Points handle drags with Shift, Ctrl/Cmd or Alt/Option set the point type; previous: trivial, progress log: scroll bars on the zoomed slide pane, #1157; previous: minor, native chart payloads stored in bounded ZIP members; previous: major, community PR wave 2026-10-14: ~60 landed items in the progress log, among them the Font, Paragraph, Photo Album, theme colour and font and Date and Time dialogs, presenter and show controls, the SmartArt Text Pane and PPTX corpus slices; breadth 84% after `cargo xtask parity`, ready stays ~55%, stage stays alpha; duplicated rows and headers folded; previous: minor, hours to ~95% per audience added) · **Target:** Microsoft PowerPoint for Mac 16.113 (Microsoft 365)
66
> **Last reviewed:** 2026-10-14 · **Last updated:** 2026-10-22 · **Change:** trivial (fill and outline edits reach group members, #1079; stage and scores unchanged) · **Target:** Microsoft PowerPoint for Mac 16.113 (Microsoft 365)
77
> **Last reviewed:** 2026-10-14 · **Last updated:** 2026-10-20 · **Change:** trivial (empty chart number-format sections hide values; previous: minor, native chart payloads stored in bounded ZIP members; previous: major, community PR wave 2026-10-14: ~60 landed items in the progress log, among them the Font, Paragraph, Photo Album, theme colour and font and Date and Time dialogs, presenter and show controls, the SmartArt Text Pane and PPTX corpus slices; breadth 84% after `cargo xtask parity`, ready stays ~55%, stage stays alpha; duplicated rows and headers folded; previous: minor, hours to ~95% per audience added) · **Target:** Microsoft PowerPoint for Mac 16.113 (Microsoft 365)
88
> **Last reviewed:** 2026-10-14 · **Last updated:** 2026-10-18 · **Change:** minor (Symbol-font characters (U+F0xx) remap to the installed Symbol face's real Unicode on macOS, so they draw from Symbol instead of a look-alike; previous: minor, native chart payloads stored in bounded ZIP members; previous: major, community PR wave 2026-10-14: ~60 landed items in the progress log, among them the Font, Paragraph, Photo Album, theme colour and font and Date and Time dialogs, presenter and show controls, the SmartArt Text Pane and PPTX corpus slices; breadth 84% after `cargo xtask parity`, ready stays ~55%, stage stays alpha; duplicated rows and headers folded; previous: minor, hours to ~95% per audience added) · **Target:** Microsoft PowerPoint for Mac 16.113 (Microsoft 365)
@@ -161,6 +161,7 @@ app's JSON control channel (`deckcraft --control PORT`).
161161
| 2026-10-19 | README: the Linux runtime libraries a tarball or musl install has to provide — the `dlopen`ed X11/Vulkan/GL/dialog libraries with their Alpine and Void package names, the software-Vulkan fallback, and why fontconfig and freetype are not among them (#955) |
162162
| 2026-10-17 | Opening a file caps absurd effect sizes (glow, soft edges, shadows, reflections, on shapes, text and table text) at what Format Shape allows: a glow of 10^18 pt in a .pptx made rendering ask for 34 GB and abort |
163163
| 2026-10-17 | Opening a .deckcraft file whose shapes repeat an id gives the repeats fresh ids (groups, layouts and masters too), so the deck validates and edits by id find one shape |
164+
| 2026-10-24 | Edit Points: hold Shift, Ctrl or Alt while dragging a point's handle to make it a smooth, straight or corner point, as in PowerPoint (Cmd and Option work as Ctrl and Alt on the Mac); the point keeps that type for the next drag |
164165
| 2026-10-17 | Edit Points: turning a shape into a freeform is one undo step, so Undo brings the original shape back (it used to stay a freeform) |
165166
| 2026-10-17 | While a placeholder's text is being edited, a click on a shape in front of it selects that shape instead of moving the caret, as in PowerPoint (#931) |
166167
| 2026-10-16 | Symbol-font characters: a run's U+F0xx symbol code (from `<a:sym typeface="Symbol"/>`) now draws from the installed Symbol face even when it has no private-use mapping — Apple's Symbol on macOS maps the glyphs to real Unicode, so the code is remapped to that character (the Adobe Symbol encoding) instead of falling to a look-alike. Bullets and metafile text take the same remap |
@@ -285,6 +286,7 @@ app's JSON control channel (`deckcraft --control PORT`).
285286
| 2026-10-22 | trivial | Progress log: Animation Pane ▸ Play From. Scores unchanged |
286287
| 2026-10-23 | trivial | Progress log: scroll bars on the zoomed slide pane (#1157). Scores and milestone names unchanged |
287288
| 2026-10-24 | trivial | Progress log: the Columns dialog. Scores and milestone names unchanged |
289+
| 2026-10-24 | trivial | Progress log: Edit Points handle drags with Shift, Ctrl/Cmd or Alt/Option. Scores and milestone names unchanged |
288290
| 2026-10-20 | trivial | Explicit empty chart number-format sections hide their values; blank whole-code General fallback is retained. Synthetic formatter regressions; chart-element scores and readiness estimates unchanged |
289291
| 2026-10-21 | trivial | Progress log: Reuse Slides picker (#1103). Scores and milestone names unchanged |
290292
| 2026-10-18 | minor | Native chart payloads use referenced ZIP members and share media byte/item limits; old inline sidecars remain readable. Synthetic tests cover multi-megabyte layout, all shape owners, shared budgets, missing/corrupt members and invalid references. Scores and milestone scope unchanged |

‎crates/engine/src/cmd/edit.rs‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,16 +44,19 @@ pub fn specs() -> Vec<CommandSpec> {
4444
}
4545

4646
fn restore(s: &mut Session, redo: bool) -> Result<Value> {
47+
let vertex_kind = s.tool.vertex_kind.clone();
4748
let st = s.doc_mut()?;
4849
let (from, to) = if redo { (&mut st.history.redo, &mut st.history.undo) } else { (&mut st.history.undo, &mut st.history.redo) };
4950
let Some(e) = from.pop() else { return ok() };
50-
to.push(HistoryEntry { label: e.label.clone(), doc: st.doc.clone(), selection: st.selection.clone() });
51+
to.push(HistoryEntry { label: e.label.clone(), doc: st.doc.clone(), selection: st.selection.clone(), vertex_kind });
5152
st.doc = e.doc;
5253
st.selection = e.selection;
5354
st.interaction = None;
5455
// A later shape can get an undone copy's id: Duplicate starts over with the usual offset.
5556
st.last_duplicate = None;
5657
st.revision += 1;
58+
// The point type Edit Points remembered with the restored document: handle drags follow it.
59+
s.tool.vertex_kind = e.vertex_kind;
5760
Ok(json!({"label": e.label}))
5861
}
5962

‎crates/engine/src/cmd/points.rs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -837,7 +837,7 @@ fn point_type(s: &mut Session, p: &Value) -> Result<Value> {
837837
_ => return Err(bad("shape.pointType", "`type` is smooth, straight or corner")),
838838
};
839839
// A straight point's handles can be as long as each other; remember the choice for drags.
840-
s.tool.vertex_kind = Some((path, index, kind.clone()));
840+
s.tool.vertex_kind = Some((id, path, index, kind.clone()));
841841
edit_path(s, id, path, "shape.pointType", move |segs, vs, _| {
842842
let si = *vs.get(index).ok_or_else(|| bad("shape.pointType", "no such point"))?;
843843
set_type(segs, si, &kind);
@@ -931,7 +931,7 @@ fn close_path(s: &mut Session, p: &Value) -> Result<Value> {
931931
/// Opening or closing renumbers the points of `path`: a point type remembered for one of them
932932
/// would follow the wrong point.
933933
fn forget_kinds(s: &mut Session, path: usize) {
934-
if s.tool.vertex_kind.as_ref().is_some_and(|k| k.0 == path) {
934+
if s.tool.vertex_kind.as_ref().is_some_and(|k| k.1 == path) {
935935
s.tool.vertex_kind = None;
936936
}
937937
}

‎crates/engine/src/cmd/shape.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1646,7 +1646,7 @@ mod tests {
16461646
let mut s = Session::with_new();
16471647
s.execute("shape.insert", &json!({"preset": "ellipse", "rect": [10.0, 10.0, 30.0, 30.0]})).unwrap();
16481648
let st = s.active_mut().unwrap();
1649-
st.interaction = Some(crate::Interaction { label: "Move".into(), doc: st.doc.clone(), selection: st.selection.clone() });
1649+
st.interaction = Some(crate::Interaction { label: "Move".into(), doc: st.doc.clone(), selection: st.selection.clone(), vertex_kind: None });
16501650
s.execute("shape.rotate", &json!({"gesture": "end", "ids": []})).unwrap();
16511651
assert_eq!(s.active().unwrap().interaction.as_ref().unwrap().label, "Move");
16521652
}

‎crates/engine/src/guard.rs‎

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,15 @@ impl Session {
3636
/// Run command `id` (`f`) inside the guard.
3737
pub(crate) fn guarded(&mut self, id: &str, f: impl FnOnce(&mut Session) -> Result<Value>) -> Result<Value> {
3838
let before = self.active().map(|d| (d.uid, d.doc.clone(), d.selection.clone(), d.revision));
39+
let vertex_kind = self.tool.vertex_kind.clone();
3940
let depth = self.depth;
4041
match catch_unwind(AssertUnwindSafe(|| f(self))) {
4142
Ok(r) => r,
4243
Err(payload) => {
4344
self.depth = depth;
45+
// The remembered point type names a shape of the document it was chosen in.
46+
let same = before.as_ref().is_some_and(|b| self.active().is_some_and(|st| st.uid == b.0));
47+
self.tool.vertex_kind = if same { vertex_kind } else { None };
4448
let msg = panic_message(payload.as_ref());
4549
// Keep the document as it was before the command.
4650
if let (Some((uid, doc, selection, revision)), Some(st)) = (before, self.active_mut())
@@ -91,6 +95,29 @@ mod tests {
9195
s.execute("shape.insert", &json!({"preset": "ellipse", "rect": [36, 236, 200, 400]})).unwrap();
9296
}
9397

98+
#[test]
99+
fn a_panicking_command_keeps_the_remembered_point_type() {
100+
let mut s = Session::new();
101+
s.execute("file.new", &json!({})).unwrap();
102+
let kept = Some((deckcraft_model::ShapeId(1), 0, 0, "straight".to_string()));
103+
s.tool.vertex_kind = kept.clone();
104+
let r = s.guarded("test.panic", |s| {
105+
s.tool.vertex_kind = Some((deckcraft_model::ShapeId(1), 0, 0, "corner".to_string()));
106+
panic!("boom");
107+
});
108+
assert!(r.is_err());
109+
assert_eq!(s.tool.vertex_kind, kept);
110+
// A command that opens another document and then panics leaves no point type behind: the
111+
// one from before names a shape of the other document.
112+
let r = s.guarded("test.panic", |s| {
113+
s.execute("file.new", &json!({}))?;
114+
s.tool.vertex_kind = Some((deckcraft_model::ShapeId(1), 0, 0, "corner".to_string()));
115+
panic!("boom");
116+
});
117+
assert!(r.is_err());
118+
assert_eq!(s.tool.vertex_kind, None);
119+
}
120+
94121
#[test]
95122
fn a_command_that_fails_after_editing_leaves_the_document_alone() {
96123
let mut s = Session::new();

‎crates/engine/src/lib.rs‎

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,8 @@ pub struct HistoryEntry {
163163
pub label: String,
164164
pub doc: Arc<Presentation>,
165165
pub selection: Selection,
166+
/// The point type Edit Points remembered with `doc` (`ToolState::vertex_kind`).
167+
pub vertex_kind: Option<(ShapeId, usize, usize, String)>,
166168
}
167169

168170
#[derive(Clone, Debug, Default)]
@@ -184,6 +186,8 @@ pub struct Interaction {
184186
pub label: String,
185187
pub doc: Arc<Presentation>,
186188
pub selection: Selection,
189+
/// The point type Edit Points remembered when it began.
190+
pub vertex_kind: Option<(ShapeId, usize, usize, String)>,
187191
}
188192

189193
/// Text an input method is composing (#101): its preedit sits in the edited text body, at `start`
@@ -564,23 +568,36 @@ impl Session {
564568
self.active_mut().ok_or(EngineError::NoDocument)
565569
}
566570
pub fn set_active(&mut self, i: usize) {
571+
let was = self.active().map(|d| d.uid);
567572
if i < self.docs.len() {
568573
self.active = Some(i);
569574
}
575+
self.forget_vertex_kind_unless(was);
570576
}
571577
pub fn add_document(&mut self, d: DocState) -> usize {
578+
let was = self.active().map(|d| d.uid);
572579
self.docs.push(d);
573580
self.active = Some(self.docs.len() - 1);
581+
self.forget_vertex_kind_unless(was);
574582
self.docs.len() - 1
575583
}
576584
pub fn close_document(&mut self, i: usize) {
585+
let was = self.active().map(|d| d.uid);
577586
if i < self.docs.len() {
578587
let d = self.docs.remove(i);
579588
if let Some(dir) = &self.recovery_dir {
580589
recovery::discard(dir, d.uid);
581590
}
582591
self.active = if self.docs.is_empty() { None } else { Some(i.min(self.docs.len() - 1)) };
583592
}
593+
self.forget_vertex_kind_unless(was);
594+
}
595+
/// The point type Edit Points remembers names a shape of the active document, and another
596+
/// document can have a shape with the same id: a change of active document forgets it.
597+
fn forget_vertex_kind_unless(&mut self, was: Option<u64>) {
598+
if self.active().map(|d| d.uid) != was {
599+
self.tool.vertex_kind = None;
600+
}
584601
}
585602
pub fn next_untitled(&mut self) -> String {
586603
self.untitled += 1;
@@ -606,6 +623,7 @@ impl Session {
606623
}
607624
}
608625
let before = self.active().map(|d| (d.uid, d.doc.clone(), d.selection.clone()));
626+
let vertex_kind = self.tool.vertex_kind.clone();
609627
let outer = self.depth == 0;
610628
self.depth += 1;
611629
let r = (spec.run)(self, params);
@@ -624,6 +642,9 @@ impl Session {
624642
st.selection = sel;
625643
st.revision += 1;
626644
}
645+
if outer {
646+
self.tool.vertex_kind = vertex_kind;
647+
}
627648
return Err(e);
628649
}
629650
};
@@ -637,7 +658,7 @@ impl Session {
637658
&& spec.undoable
638659
&& outer
639660
{
640-
push_undo(st, HistoryEntry { label: spec.label.to_string(), doc: old, selection: sel });
661+
push_undo(st, HistoryEntry { label: spec.label.to_string(), doc: old, selection: sel, vertex_kind });
641662
}
642663
if spec.journal && outer {
643664
self.journal.push((id.to_string(), params.clone()));
@@ -668,10 +689,11 @@ impl Session {
668689
/// Keep an input method's composition as it stands (#101): its text stays and the whole
669690
/// composition becomes one undo step. Nothing happens without one.
670691
pub fn end_composition(&mut self) {
692+
let vertex_kind = self.tool.vertex_kind.clone();
671693
let Some(st) = self.active_mut() else { return };
672694
let Some(c) = st.composition.take() else { return };
673695
if !Arc::ptr_eq(&c.before, &st.doc) {
674-
push_undo(st, HistoryEntry { label: "Type Text".into(), doc: c.before, selection: c.before_selection });
696+
push_undo(st, HistoryEntry { label: "Type Text".into(), doc: c.before, selection: c.before_selection, vertex_kind });
675697
}
676698
}
677699

0 commit comments

Comments
 (0)