Skip to content

feat(editor): add arrow styles - #99

Open
jondkinney wants to merge 3 commits into
omacom:mainfrom
jondkinney:feat/arrow-styles
Open

feat(editor): add arrow styles#99
jondkinney wants to merge 3 commits into
omacom:mainfrom
jondkinney:feat/arrow-styles

Conversation

@jondkinney

Copy link
Copy Markdown
Collaborator

The arrow tool now includes Standard, Pointy, Curved, and Double styles. Repeatedly pressing A cycles them, and the toolbar icon mirrors the active arrow geometry.

Selected arrows can be restyled the same way. Endpoint edits honor a pre-held Shift for 45° snapping, while Shift keeps curved-arrow bends centered.

The four arrow styles

Tested with make check.

@jondkinney
jondkinney force-pushed the feat/arrow-styles branch 4 times, most recently from e361c53 to c113a80 Compare August 27, 2026 05:03
Copilot AI balanced review requested due to automatic review settings September 5, 2026 16:46

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Arrow bounds and incremental repaint logic can clip or incorrectly display curved arrows, and degenerate controls can remove arrowheads.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Adds four arrow styles with cycling, restyling, curve editing, persistence, and matching toolbar icons.

Changes:

  • Implements Standard, Pointy, Curved, and Double arrow geometry.
  • Adds style cycling, bend handles, Shift constraints, and serialization.
  • Updates documentation and smoke coverage.
File summaries
File Description
src/capture.hpp Defines arrow styles and geometry APIs.
src/capture.cpp Renders, hit-tests, bounds, and serializes arrows.
src/editor.hpp Adds arrow style and control-handle state.
src/editor.cpp Implements arrow editing and style cycling.
src/icons.cpp Renders toolbar icons from arrow geometry.
tests/editor-smoke.cpp Tests rendering, editing, persistence, and shortcuts.
README.md Documents arrow styles and controls.
Review details
  • Files reviewed: 7/7 changed files
  • Comments generated: 3
  • Review effort level: Balanced

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/capture.cpp
Comment on lines +943 to +944
QRectF arrowVisualBounds(const Annotation &annotation, qreal displayScale) {
return arrowVisualBoundsInternal(annotation, displayScale);
Comment thread src/capture.cpp Outdated
Comment on lines +533 to +537
addOpenArrowHead(geometry.stroke, annotation.end, annotation.end - control,
headSide);
if (annotation.arrowStyle == ArrowStyle::Double)
addOpenArrowHead(geometry.stroke, annotation.start,
annotation.start - control, headSide);
Comment thread src/editor.cpp
Comment on lines +6414 to +6415
if (tool_ == Tool::Arrow)
preview.arrowStyle = arrowStyle_;
Copilot AI review requested due to automatic review settings September 6, 2026 23:28

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Degenerate arrows incorrectly grow and shift the exported canvas despite rendering no geometry.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review details
  • Files reviewed: 7/7 changed files
  • Comments generated: 1
  • Review effort level: Balanced

Comment thread src/capture.cpp Outdated
Comment on lines +149 to +150
if (annotation.kind == Annotation::Kind::Arrow)
return arrowVisualBounds(annotation).adjusted(-1, -1, 1, 1);
Copilot AI review requested due to automatic review settings September 7, 2026 00:34

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The implementation is cohesive, documented, and comprehensively exercised by the smoke tests.

Review details
  • Files reviewed: 7/7 changed files
  • Comments generated: 0 new
  • Review effort level: Balanced

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.

2 participants