Skip to content

fix: 選択アンカーだけを整列する #1180 - #1211

Closed
haranishi wants to merge 1 commit into
storytold:mainfrom
haranishi:fix/issue-1180-align-anchors
Closed

haranishi wants to merge 1 commit into
storytold:mainfrom
haranishi:fix/issue-1180-align-anchors

Conversation

@haranishi

@haranishi haranishi commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

What and why

Closes #1180.

Direct Selectionでパスの一部のアンカーを選んだとき、Alignがパス全体を移動する不具合を修正します。M100 40 L200 60 L150 160 Z の上側2点を選んでVertical Align Centerを実行すると、選択点のYが50に揃い、3点目は (150, 160) に残ります。

選択点の位置から整列範囲を求め、各アンカーとそのハンドルを移動します。Align to Artboardにも対応します。パスが1つでもアンカー選択中はAlignパネルの指定先を使います。変更は1回のUndoで戻り、同じ整列を繰り返してもUndo履歴を増やしません。

操作仕様は公開ドキュメントを参照しました。キーアンカーによる整列は引き続き未実装です。

How it was tested

  • エンジンの回帰テスト5件:選択点の上端・中央・下端整列、ハンドル追従、Undo/Redo、アートボードへの2軸整列、別パス間の整列、変化のない整列、パス全体の整列。
  • eguiのポインターイベントでAlignパネルのVertical Align Centerをクリックし、選択点だけが動くことを検証。
  • 実ウィンドウでVertical Align Centerをクリック。選択点は (100, 50)・(200, 50)、未選択点は (150, 160) のまま。Undo/Redo後も座標を確認。
  • cargo xtask ci:macOSで全7工程成功(fmt、clippy、5,332テスト成功・失敗0件・4件ignore、assets、brands、layers、wasm)。craft-fontsは指定せず、任意フォントが必要なテストは既存ルールに従ってスキップします。GitHub Actionsの全CIも同じコミット c98cfeec で成功しました。
  • Affinity corpusをピン留めされたリビジョンから取得し、SHA-256検証後、上流CIと同じAffinity全機能テストとエンジンの3テスト対象を実行:74件成功・失敗0件。DejaVuSansの完全一致テストは未インストールのためスキップ。元リポジトリのAffinity 3 corpus CIも成功しました。

Checklist

  • cargo xtask ci passes (fmt, clippy, tests, assets, brands, layers, wasm).
  • No panics in shipped code; errors are returned as Result.
  • Clean-room: nothing copied from Adobe products or GPL/AGPL code.
  • Every new asset has a row in ASSETS.md (新しい資産の追加なし)。

@haranishi
haranishi marked this pull request as ready for review October 11, 2026 15:11
Copilot AI balanced review requested due to automatic review settings October 11, 2026 15:11

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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@haranishi

Copy link
Copy Markdown
Contributor Author

@echelon Could you review this anchor-alignment fix? The PR is ready for review.

The full Linux + wasm quality gate passed for the exact PR commit c98cfeec: https://github.com/haranishi/vectorcraft/actions/runs/38148921366. The full macOS gate, native Align-panel click with Undo/Redo, and 74 pinned Affinity corpus tests also passed. The upstream Affinity workflow is still queued. Details and scope are in the PR description.

GitHub does not allow this fork author to assign a reviewer, so I am requesting review here.

@bflatastic

Copy link
Copy Markdown
Member

Thank you for this @haranishi, and welcome! #1216 fixed #1180 the same way about ten minutes before this PR opened: Align moves only the selected anchors, to their bounds or to the artboard. So I'm closing this one as a duplicate. Sorry for the overlap. Your tests are thorough. If you find a case where main still aligns differently from yours (repeating a no-op alignment, for example), a follow-up PR with that test would be very welcome.

Your compound-path follow-up (#1225) is being checked now.

If you'd like to chat with the team, come say hi on Discord: https://discord.gg/artcraft

@haranishi

Copy link
Copy Markdown
Contributor Author

Thanks for the suggestion. I reproduced the repeated no-op alignment case and submitted the regression test and fix in #1276, which is now merged. Repeating an alignment that does not move the selected anchors no longer adds an Undo step. The original anchor-alignment fix remains the one from #1216.

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.

Bug: Cannot Align Two Selected Anchor Points in version 0.9.0

3 participants