Skip to content

feat(core): add arrow snap-to-shape connection points#35

Merged
lostmygithubaccount merged 1 commit into
mainfrom
feat/arrow-snap
Apr 12, 2026
Merged

feat(core): add arrow snap-to-shape connection points#35
lostmygithubaccount merged 1 commit into
mainfrom
feat/arrow-snap

Conversation

@lostmygithubaccount
Copy link
Copy Markdown
Member

Summary

  • Arrows snap to 8 connection points (4 corners + 4 edge midpoints) on Rectangle, Ellipse, and Diamond shapes when within 15px
  • Visual snap indicator (accent-colored dot) appears during arrow creation
  • Bound arrows auto-update endpoint positions when connected shape is moved or resized
  • Existing free-form arrow behavior preserved when not near a shape

🤖 Generated with Claude Code

Arrows now snap to 8 connection points on shapes (4 corners + 4 edge
midpoints) when dragged within 15px. Visual indicator dot appears at
candidate snap point. Bound arrows auto-update when connected shape is
moved or resized. Works for Rectangle, Ellipse, and Diamond shapes.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@lostmygithubaccount lostmygithubaccount enabled auto-merge (squash) April 12, 2026 04:21
@lostmygithubaccount lostmygithubaccount merged commit 5af3652 into main Apr 12, 2026
1 check passed
@lostmygithubaccount lostmygithubaccount deleted the feat/arrow-snap branch April 12, 2026 04:23
lostmygithubaccount added a commit that referenced this pull request Apr 13, 2026
Existing coverage is per-module unit tests. This adds a tests/integration.rs
exercising draw-core as an external consumer would — only `pub use` re-exports
from the crate root.

New coverage:
- Full pipeline across all 7 element types: new -> populate -> JSON round-trip
  -> save/load -> SVG export (per-type tag checks) -> PNG export (magic bytes)
- Arrow start_binding/end_binding round-trip (Binding added in #35, had no
  test coverage)
- Legacy doc parsing when binding fields are absent (serde default=None)
- Element dispatch helpers (id/position/set_position/opacity/is_locked/group_id)
  across every variant
- Empty-document SVG/PNG exports don't panic

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
lostmygithubaccount added a commit that referenced this pull request Apr 13, 2026
Existing coverage is per-module unit tests. This adds a tests/integration.rs
exercising draw-core as an external consumer would — only `pub use` re-exports
from the crate root.

New coverage:
- Full pipeline across all 7 element types: new -> populate -> JSON round-trip
  -> save/load -> SVG export (per-type tag checks) -> PNG export (magic bytes)
- Arrow start_binding/end_binding round-trip (Binding added in #35, had no
  test coverage)
- Legacy doc parsing when binding fields are absent (serde default=None)
- Element dispatch helpers (id/position/set_position/opacity/is_locked/group_id)
  across every variant
- Empty-document SVG/PNG exports don't panic

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
lostmygithubaccount added a commit that referenced this pull request Apr 13, 2026
Bumps all Rust crates and the Python package from 0.2.1 to 0.3.0. This
minor bump reflects one breaking change in the dkdc-draw-core public API
surface (pub -> pub(crate) demotions in #42), accumulated with the
non-breaking work from this cycle:

  - #35: arrow snap-to-shape connection points
  - #36: CONTRIBUTING.md + README badges
  - #37: integration tests for draw-core public API
  - #38: Rust + Python hello-world examples
  - #39: CHANGELOG.md scaffolding
  - #40: surgical clippy opt-ins workspace-wide
  - #41: sample gallery (5 drawings × json/svg/png)
  - #42: pub -> pub(crate) demotions (BREAKING)
  - #43: Python test coverage 5 -> 27

See CHANGELOG.md for the 0.3.0 section and migration notes for the
demoted symbols.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@lostmygithubaccount lostmygithubaccount mentioned this pull request Apr 13, 2026
4 tasks
lostmygithubaccount added a commit that referenced this pull request Apr 13, 2026
Bumps all Rust crates and the Python package from 0.2.1 to 0.3.0. This
minor bump reflects one breaking change in the dkdc-draw-core public API
surface (pub -> pub(crate) demotions in #42), accumulated with the
non-breaking work from this cycle:

  - #35: arrow snap-to-shape connection points
  - #36: CONTRIBUTING.md + README badges
  - #37: integration tests for draw-core public API
  - #38: Rust + Python hello-world examples
  - #39: CHANGELOG.md scaffolding
  - #40: surgical clippy opt-ins workspace-wide
  - #41: sample gallery (5 drawings × json/svg/png)
  - #42: pub -> pub(crate) demotions (BREAKING)
  - #43: Python test coverage 5 -> 27

See CHANGELOG.md for the 0.3.0 section and migration notes for the
demoted symbols.

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant