Skip to content

Edit a hatch on double-click and from the context menu - #2109

Merged
HakanSeven12 merged 1 commit into
HakanSeven12:mainfrom
cmlad26:fix/double-click-hatch-edit
Oct 24, 2026
Merged

HakanSeven12 merged 1 commit into
HakanSeven12:mainfrom
cmlad26:fix/double-click-hatch-edit

Conversation

@cmlad26

@cmlad26 cmlad26 commented Oct 24, 2026

Copy link
Copy Markdown
Contributor

Summary

Hatches could not be edited by picking them: HATCHEDIT/HE never picked a hatch, and double-clicking or right-clicking a hatch offered no edit action.

  • HATCHEDIT pick: a hatch has no boundary wire, so the wire-only pick never hit one. While waiting for the hatch, HatcheditCommand now opts into fill hit-testing (entity_pick_includes_fills).
  • Double-click: double-clicking a hatch now finds it the way a single click does: first the wire, then the hatch fill, then a block's hatch (its INSERT). It then selects the hatch and starts HATCHEDIT, which skips its pick because the hatch is already selected.
    • AutoCAD's default double-click action for a hatch is Quick Properties; I checked this in a stock acad.cuix (DoubleClickAction HATCH → ID_QUICKPROPERTIES).
    • OpenCADStudio already shows Properties on a single click, so the double-click edits instead. I think that is the more useful choice, but I am happy to change it if you prefer the AutoCAD behaviour.
  • Context menu: with exactly one hatch selected, the right-click menu now starts with Edit Hatch, as AutoCAD's does.

Tests

New tests:

  • double_clicking_a_hatch_starts_hatchedit_on_it
  • hatchedit_picks_a_hatch_by_its_fill
  • a_selected_hatch_gets_edit_hatch_in_the_context_menu
  • a_single_selected_hatch_offers_edit_hatch_first

cargo test --workspace --locked passes. I also checked by hand on a real architectural drawing:

  • double-click edits the hatch;
  • HE picks a hatch;
  • the menu row appears only when a single hatch is selected.

🤖 Generated with Claude Code

HATCHEDIT could not pick a hatch: a hatch has no boundary wire, and
the command did not ask the pick to hit-test fills. It now does while
waiting for the hatch.

Double-clicking a hatch resolves it by its fill (then a block's hatch)
like a single click, selects it and starts HATCHEDIT on it. AutoCAD's
default double-click action for a hatch is Quick Properties, but
Properties already follows a single click here, so the double-click
edits.

With exactly one hatch selected, the right-click menu leads with
"Edit Hatch", as in AutoCAD.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@HakanSeven12
HakanSeven12 merged commit 9f43948 into HakanSeven12:main Oct 24, 2026
6 checks passed
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