The colour selector popup now lists only the named colours (ByLayer,
ByBlock, ACI 1-9) plus a "More…" entry. "More…" opens a standalone
"Select Color" window with the full 256-colour grid; picking there applies
to the originating field (dimension/multileader/table style) and closes
the window. Routed via a ColorPickTarget so one window serves every field.
Co-Authored-By: Claude Opus 4.8 <[email protected]>
The colour list/palette was laid out inline, shifting everything below it
down when opened. Wrap it in a small custom widget (Floating) that renders
the button inline and the popup as an iced overlay anchored below it, so it
floats over the UI like a real dropdown. Picking a colour now also closes
the popup (the style editors clear their open-field state on edit).
Co-Authored-By: Claude Opus 4.8 <[email protected]>
Reworked the shared colour selector from a plain text pick_list into a
dropdown button that opens a list where each named colour (ByLayer,
ByBlock, ACI 1-9) shows its swatch next to the name, with the full ACI
palette grid below. The dimension/multileader/table style editors pick
it up unchanged.
Co-Authored-By: Claude Opus 4.8 <[email protected]>
Add a reusable color_selector widget (ui/color_select.rs): a main-colour
dropdown plus a "more colours" button that expands the full 255-entry ACI
palette — the same design the properties panel uses. Replace the flat ACI
swatch rows added earlier in the dimension, multileader and table style
editors with it, wired through each editor's existing colour edit message
(the chosen colour is encoded as an ACI string) plus a per-field
palette-open toggle.
Co-Authored-By: Claude Opus 4.8 <[email protected]>
Dimension, multileader and table style editors took colours as raw ACI
integers in a text box. Replace those with a swatch row (the 9 standard
ACI colours + ByLayer) that highlights the current value, reusing each
editor's existing colour edit message (the chosen index is sent as the
field's string value, so no new plumbing).
Text styles carry no colour field, so none was needed there.
Co-Authored-By: Claude Opus 4.8 <[email protected]>
2-D fills (the DIMTFILL background) render in a pass before all wires, so
the background could never sit above the dimension line — the line showed
through it. When the text sits on the line, gap the dimension line across
the text box (AutoCAD-style break) so the background reads cleanly over
the line. Text placed above/below the line is unaffected.
Co-Authored-By: Claude Opus 4.8 <[email protected]>
A new multileader was built from defaults and ignored the current
MLeaderStyle, so the style editor's settings had no effect on it (the
renderer reads the entity's own fields, not the style). commit_entity_handle
now copies the style's content/path type, text attachment/alignment/angle,
colours, sizes, scale and landing into the new entity (enum types
round-trip through i16 since the entity and style enums are distinct).
Text styles already render correctly and tables already resolve their
style live via table_style_handle, so no change was needed there.
Co-Authored-By: Claude Opus 4.8 <[email protected]>
- DIMZIN now drives architectural feet/inch zero-suppression (modes 0-3)
inside format_architectural, threaded through format_with_unit (primary
and alternate units).
- DIMJUST 3 and 4 (over first / second extension) now rotate the text 90°
to read along the extension line, not just shift its position.
- DIMTAD 2 (outside) and 3 (JIS) resolve to the away-from-object side,
which equals "above" for 2-D linear dims; clarified in a comment.
Co-Authored-By: Claude Opus 4.8 <[email protected]>
Two style settings were accepted by the editor but ignored by the
renderer:
- DIMTAD=4 (Below) placed text above the dimension line like DIMTAD=1;
the text is now offset to the opposite side.
- DIMTFILL=1 (drawing background) drew no fill; it now masks the geometry
behind the text with the background colour (DIMTFILL=2 already used
DIMTFILLCLR).
Verified the other enum settings render: DIMLUNIT/DIMFRAC unit formats,
DIMAUNIT/DIMADEC/DIMAZIN angular formats, DIMJUST positions,
DIMATFIT/DIMTMOVE fit, DIMTOLJ tolerance alignment, and the alternate-unit
/ zero-suppression families.
Co-Authored-By: Claude Opus 4.8 <[email protected]>
The dimension style editor exposed every enum setting (DIMTAD, DIMJUST,
DIMLUNIT, DIMTMOVE, DIMATFIT, DIMTFILL, DIMFRAC, DIMAUNIT, DIMAZIN,
DIMALTU, DIMTOLJ, DIMARCSYM, and the zero-suppression family) as a raw
integer text box, forcing the user to type codes like "1". Replace them
with named pick_list dropdowns via an enum_field helper that maps the
stored code to a label and back. Numeric fields (sizes, colours,
decimals) and obsolete flags (DIMUNIT/DIMFIT) keep their text inputs.
Co-Authored-By: Claude Opus 4.8 <[email protected]>
When the dimension line is too short for the arrowheads, they are now
placed outside the extension lines (tip on the line, body outward) with a
short stub to sit on, instead of overlapping inside. DIMSOXD suppresses
those outer stubs. Ticks are unaffected (they always fit).
DIMATFIT's exact mode ordering and DIMUPT remain for a later pass.
Co-Authored-By: Claude Opus 4.8 <[email protected]>
Centred dimension text that doesn't fit between the extension lines now
slides outside (text-outside placement), unless DIMTIX forces it to stay
inside. DIMTOFL is already satisfied for linear/aligned dims (their dim
line is always drawn between the extension points).
The remaining style flags are documented in place:
- DIMATFIT arrow-outside modes and DIMUPT need an arrow autofit pass.
- DIMTXTDIRECTION (RTL) needs single-line text direction support.
- DIMARCSYM / DIMJOGANG apply only to arc-length / jogged-radius dims,
which aren't shipped as entity variants.
- DIMUNIT is obsolete (superseded by DIMLUNIT).
Co-Authored-By: Claude Opus 4.8 <[email protected]>
Dimension text position ignored the style: the renderer returned the
saved text_middle_point whenever it was non-zero, which it always is for
app-created dims, so DIMTAD ("text over the dimension line" / ISO) and
friends had no effect — text could only be moved by grips.
Use the new acadrust text_user_positioned flag: when the text wasn't
user-placed, compute the position from the style (DIMTAD/DIMTVP/DIMJUST)
anchored on the dimension line (definition_point); when it was (grip drag
or properties edit, both now set the flag), keep the saved point.
Imported drawings keep their fidelity via the flag round-tripping through
DXF/DWG.
Also fixes linear/aligned text anchoring at the measured midpoint instead
of the actual dimension line.
Co-Authored-By: Claude Opus 4.8 <[email protected]>
Follow-up to the text/dimension fix: MultiLeader and Table were created
at their default style too. Their styles live in the objects dictionary,
so commit_entity_handle now resolves header.current_mleader_style_name /
current_table_style_name to the matching style object's handle and
assigns it, unless the command already set one or no such style exists.
Co-Authored-By: Claude Opus 4.8 <[email protected]>
New annotation entities were created at the entity "Standard" default
instead of the document's current style, so making a style current had
no effect on creation.
- Text / MText: seed the new entity (and the MText editor preview) from
header.current_text_style_name.
- Dimension: commit_entity_handle fills the new dimension's style_name
from header.current_dimstyle_name, covering every dimension command
centrally.
Applied only when the entity is still at its default so an explicitly
styled entity is preserved. MLeader and Table styles need their style
tables modelled first and are left for follow-up.
Co-Authored-By: Claude Opus 4.8 <[email protected]>
A command step that takes both a point and option keywords (PLINE,
MLINE) returns true from wants_text_input to receive the keywords, but
CommandSubmit then routed the text only to on_text_input and, on a None
(unhandled) result, re-prompted instead of falling through. So with
dynamic input off, typed coordinates and a bare Enter were swallowed —
points couldn't be added by keyboard and the command couldn't be ended.
Fall through to the existing Enter / coordinate handling when
on_text_input doesn't consume the text. Coordinates (including @ and #
prefixes) and Enter now work in these steps with DYN both on and off;
commands that fully handle their text step still return Some and are
unaffected.
Co-Authored-By: Claude Opus 4.8 <[email protected]>
The Start (welcome) tab has no drawing, so commands like LINE dispatched
from the command line or ribbon ran as silent no-ops. Allow only the
commands that make sense there (NEW / OPEN / EXIT / QUIT; OPEN_RECENT is
handled earlier) and inform the user otherwise.
Co-Authored-By: Claude Opus 4.8 <[email protected]>
STRETCH edited geometry directly via document.get_entity_mut, which the
scene's tessellation cache doesn't observe, so the viewport kept showing
the pre-stretch shape until an unrelated redraw. Mark each stretched
entity dirty and bump geometry on completion, matching MOVE's
transform_entities path.
Co-Authored-By: Claude Opus 4.8 <[email protected]>
Making a layer current via the layer manager (LayerSetCurrent) or
LAYMCUR updated only the per-tab active_layer, not the document
header's current_layer_name/handle. The no-selection ribbon refresh
reads the header layer, so after the change an Esc (deselect ->
refresh_properties) snapped the active-layer dropdown back to the
stale header value ("0") even though new entities still used the
correct active layer. Mirror the change into the header in both paths,
matching the ribbon dropdown's own set-current path.
Co-Authored-By: Claude Opus 4.8 <[email protected]>
The last corner of a closed polyline joins its first (0) and last (n-1)
segments at vertex 0, but the corner fillet/chamfer used corner_idx
high%n (= n-1) and treated seg low as the "before" segment, so the
shared vertex and the before/after order were both wrong — producing a
fillet/chamfer at the wrong place. Detect the wrap pair and map
before_seg=n-1, after_seg=0, corner_idx=0. Applies to FILLET and
CHAMFER.
Co-Authored-By: Claude Opus 4.8 <[email protected]>
TrimCommand::on_entity_replaced never matched LwPolyline, so a trimmed
(closed or open) polyline kept a NULL handle in the command's entity
snapshot. A second pick on the same polyline then found nothing, so it
could not be trimmed more than once without restarting the command.
ExtendCommand already handled this case.
Co-Authored-By: Claude Opus 4.8 <[email protected]>
Starting FILLET/CHAMFER from the ribbon left the command-line field
unfocused, so its Enter arrived as CommandFinalize and discarded a
typed option keyword ("R"/"D"), cancelling the command. Several
related dynamic-input issues surfaced from the same flow:
- CommandFinalize now forwards a non-empty command-line buffer through
CommandSubmit, so a typed keyword is handled the same whether the
command was started from the ribbon or the command line.
- sync_dyn_fields shows no coordinate box during an object-pick step
(needs_entity_pick / needs_structure_point_pick) — there is no point
to enter there, so typed keywords reach the command line cleanly.
- apply_cmd_result rebuilds the dynamic-input fields on NeedPoint, so a
step change (object pick -> radius entry) shows the matching box
immediately and typed digits land in it instead of the command line.
- Object-pick steps now draw a prompt-only hint pill at the cursor
(no input box).
- FILLET/CHAMFER remember the first pick across a mid-selection radius
or distance entry, resuming the second pick instead of restarting
selection.
Co-Authored-By: Claude Opus 4.8 <[email protected]>
WixUI_Minimal fell back to WiX's built-in placeholder (Lorem ipsum)
RTF because no WixUILicenseRtf was set. Ship License.rtf generated
from the repo GPL-3 LICENSE and point the variable at it via a new
-dLicense candle arg.
Co-Authored-By: Claude Opus 4.8 <[email protected]>
candle rejects RegistryValue/@Name='' — the DefaultIcon and
shell\open\command rows must write the key's default value by
omitting Name entirely. Empty Name broke the MSI build.
Co-Authored-By: Claude Opus 4.8 <[email protected]>
Adds a release_tag input so the workflow can be manually triggered
to rebuild and upload artifacts to an already-published release
(e.g. after a hotfix on main without re-tagging).
https://claude.ai/code/session_01F7yMUY48VuGNUF1Q3ma2cZ
Both the MSI and the portable build were missing Applications\OpenCADStudio.exe\
DefaultIcon, causing a blank generic icon in the "Open with" context-menu list
and the "Choose another app" picker.
- packaging/windows/main.wxs: add Applications\OpenCADStudio.exe\DefaultIcon
(+ FriendlyAppName, shell\open\command, SupportedTypes) to the
DefaultPrograms component for MSI installs (HKLM).
- src/io/file_association.rs: add DefaultIcon to the Applications\
OpenCADStudio.exe block written at runtime for portable builds (HKCU).
https://claude.ai/code/session_01DFVSKgViFaxEjZD2KsTdtt
The .desktop file used a named icon (Icon=io.github.HakanSeven12.OpenCadStudio)
but the icon file was never written to the XDG icon theme directory, so file
managers and the "Open with" picker fell back to a generic blank document icon.
install_icon() now writes assets/logo.svg (embedded at compile time) to
~/.local/share/icons/hicolor/scalable/apps/{APP_ID}.svg alongside the
.desktop file, and runs gtk-update-icon-cache so the change is picked up
immediately. The write is skipped when the on-disk file is already identical.
https://claude.ai/code/session_01DFVSKgViFaxEjZD2KsTdtt
Renaming a layout tab left keyboard focus on the command line, so typed
characters landed there until the user clicked the tab. Give the inline
rename text_input a stable id and return a focus task when the rename
starts so the user types straight into the field. (issue #86)
Co-Authored-By: Claude Opus 4.8 <[email protected]>
OTRACK acquired points only ever cleared when a command ended, so a
multi-point command (LINE, etc.) accumulated tracking points across
every input, swamping the user with alignment options. Clear the
acquired points and live alignment vector each time a point is committed
to the active command, at all five point-accept paths. (issue #85)
Co-Authored-By: Claude Opus 4.8 <[email protected]>
An empty box or lasso drag called deselect_all, discarding a selection
the user may have built up over several picks. Drop the empty-clear from
the lasso and two-click box paths so a stray empty drag leaves the
selection untouched; Esc remains the deliberate clear. (issue #83)
Co-Authored-By: Claude Opus 4.8 <[email protected]>
For MSI installs the installer already writes HKLM Capabilities +
RegisteredApplications, so the "Set as default" dialog works. For
portable .exe builds those registry keys are never created, so the
IApplicationAssociationRegistrationUI dialog silently does nothing.
register_handler() now also writes:
- HKCU\Software\Classes\Applications\OpenCADStudio.exe (Open-with list)
- HKCU\Software\Classes\OpenCADStudio.DWG / .DXF (ProgIDs + icon + open cmd)
- HKCU\Software\Classes\.dwg|.dxf\OpenWithProgids
- HKCU\Software\Open CAD Studio\Capabilities (AssociationToasts shown)
- HKCU\Software\RegisteredApplications (Windows Default Programs)
This makes the "Yes, set as default" button work correctly for portable
builds on all supported Windows versions.
https://claude.ai/code/session_01DFVSKgViFaxEjZD2KsTdtt
Installed builds already register a handler (MSI ProgIDs, the Linux
.desktop MimeType, the macOS Info.plist), but the portable .exe and the
AppImage register nothing, so they never appear in the OS "Open with"
list. Add a best-effort, idempotent runtime registration that runs
silently on a detached thread at startup:
* Windows — writes HKCU\Software\Classes\Applications\OpenCADStudio.exe
(open command + FriendlyAppName + SupportedTypes .dwg/.dxf), which is
what lists the exe in "Open with → Choose another app".
* Linux — writes a user-level .desktop pointing at the running binary
($APPIMAGE when set) and refreshes the desktop database. Skipped when
a system package already provides the desktop entry, so we never
shadow a distro install.
* macOS — no-op; .app bundles auto-register with LaunchServices.
Unlike the default-app prompt this changes no defaults and shows no UI;
it only makes the binary discoverable as a handler.
https://claude.ai/code/session_01DFVSKgViFaxEjZD2KsTdtt
On the first launch that hasn't answered it yet, the app shows a small
dialog offering to become the default handler for .dwg and .dxf files.
The choice is persisted (default_assoc_prompted) so the prompt never
reappears.
The platform plumbing lives in io/file_association.rs:
* Windows — opens the OS's own per-app default-programs dialog via
IApplicationAssociationRegistrationUI::LaunchAdvancedAssociationUI,
passing the "Open CAD Studio" RegisteredApplications name the MSI
registers. Modern Windows guards the actual default behind a
UserChoice hash, so this is the supported consent path.
* Linux — xdg-mime default against the installed .desktop file, whose
MimeType entries already cover image/vnd.dwg and image/vnd.dxf.
* macOS — LSSetDefaultRoleHandlerForContentType binds the DWG/DXF UTIs
declared in Info.plist to the app bundle id.
The work runs on a dedicated thread (the Windows dialog is modal) with
the result delivered back through a oneshot channel and surfaced in the
command line.
https://claude.ai/code/session_01DFVSKgViFaxEjZD2KsTdtt
Adds a DefaultPrograms component publishing Capabilities and a
RegisteredApplications entry under HKLM. This makes Open CAD Studio
appear in Settings > Default Apps and the shell "Open with" list, so
users can set it as the default handler for .dwg and .dxf files.
Modern Windows guards the actual default behind a per-user UserChoice
hash that an installer cannot forge, so this is the supported path to
becoming the default rather than silently overwriting the association.
https://claude.ai/code/session_01DFVSKgViFaxEjZD2KsTdtt
Moves the WixUI_Minimal UI and finish-screen launch checkbox out of
main.wxs into a dedicated ui.wxs fragment, referenced from main.wxs via
<UIRef Id='OpenCADStudioUI'>. Keeps the package/feature definition and
the UI concerns in separate files.
Updates the release workflow to compile both .wxs files (candle now
writes per-source .wixobj into a directory) and link both objects.
https://claude.ai/code/session_01DFVSKgViFaxEjZD2KsTdtt
Adds WixUI_Minimal UI to the WiX installer so users see a proper
Welcome → Progress → Finish wizard. The finish screen includes a
pre-ticked "Launch Open CAD Studio" checkbox; clicking Finish with
it checked starts the application immediately after the installer closes.
Also updates the light.exe invocation in release.yml to include
-ext WixUIExtension, which is required to link the WixUI dialogs.
https://claude.ai/code/session_01DFVSKgViFaxEjZD2KsTdtt
hdiutil create intermittently fails with "Resource busy" on the hosted
macOS runner (stale mount / background indexer), failing an otherwise
successful build. Detach any leftover volume and retry up to five times
before giving up, then assert the image exists.
Co-Authored-By: Claude Opus 4.8 <[email protected]>
Switching to a paper layout used to hijack the ribbon with a contextual
"Layout" tab. Replace that with a reusable right-edge vertical toolbar:
a single centred column of icon buttons floated over the canvas, built
from a flat ToolDef list and dispatching through the existing
RibbonToolClick path (ui::side_toolbar). Paper space now shows Viewport /
Page Setup / Export PDF there and leaves the ribbon on the user's tab;
the contextual layout tab and its three auto-switch hooks are removed.
The toolbar is generic infrastructure for future context action sets.
Co-Authored-By: Claude Opus 4.8 <[email protected]>
The Annotate style dropdowns (text / dimension / multileader / table) and
the layer dropdown were hard-coded to "Standard" / "0" and never synced
from the opened document, so they showed placeholder values even with no
file open and stale values after closing one.
- Start the ribbon's style and layer lists empty instead of with a
placeholder entry.
- Sync the style dropdowns from the document on file open and on tab
new/switch/close (the layer sync already ran there).
- Guard sync_ribbon_layers / sync_ribbon_styles / sync_ribbon_from_selection
for the Start (welcome) tab so all three dropdowns stay empty there.
- When a style family is absent (e.g. no table/multileader styles), fall
back to empty rather than a non-existent "Standard".
Co-Authored-By: Claude Opus 4.8 <[email protected]>
Box selection is a two-click window (corner, corner): the first empty
click armed the box AND cleared the selection, and the box completion
cleared again before applying its hits — so a second box dropped
everything the first one picked. Stop clearing on the arming click and
make the completion accumulate like individual picks (#47): a plain box
or lasso adds, Shift+box/lasso removes the enclosed entities, an empty
box/lasso (or Esc) clears.
Fixes#83
Co-Authored-By: Claude Opus 4.8 <[email protected]>
build_geos only turned Line/Arc/Circle/Ray/XLine/Ellipse/Spline into
cutting-edge geometry, so a polyline contributed no boundary and a line
could not be trimmed (or extended) against it — even though trimming the
polyline itself against lines already worked. Explode each polyline
(LwPolyline / Polyline / Polyline2D / Polyline3D) into its Line + Arc
segments and add them as boundaries, tagged with the polyline's handle so
the click-target self-exclusion still holds. Factored the per-entity Geo
build into geo_from_entity and exposed explode_polyline_segments.
Co-Authored-By: Claude Opus 4.8 <[email protected]>