Commit Graph
2266 Commits
Author SHA1 Message Date
code-compliant 8f2a89d048 Properties: a pending edit follows the whole attribute (#1213)
The pending snapshot and the dialog's stale-row check compared the fields a
row shows: tag, prompt, value, insertion point and flags. Two attributes can
match all of those and still be different attributes. With two editable `T=v`
definitions at the same insertion point, texts 1 and 2 high, typing into the
first Properties field and then running `battman {"name":"Twin","action":
"down","tag":"T"}` leaves every compared field equal while the reorder puts
the height-2 attribute in that place; Enter wrote the typed text there, and
the dialog applied its stale row the same way, both without a message.

The row now keeps the whole stored attribute: `AttributeRow::record`, the
engine's own `Attrib` (its text, its own layer, colour, linetype and
lineweight overrides, its modes and its multiline text). A pending edit and a
dialog row are bound to that record, so any stored property that differs
refuses the stale text and says so. The displayed fields stay for the list.

Equality is the drawing data's: two attributes identical in every stored
property are interchangeable, so a swap between them still applies. Text
holding a NaN never equals itself, so such a row refuses a pending edit; it
does not panic.

Tests: both paths write the height-2 attribute without the record comparison
and change nothing with it, checked by height.
2026-11-23 20:06:56 +08:00
code-compliant 3149c42abb Properties: stale attribute text never reaches another attribute (#1213)
The pending snapshot kept a tag and a value, and two attributes can share
both: with definitions `T=v` at [0,1] and [0,2], typing into the first row and
then running `battman {"name":"Twin","action":"down","tag":"T"}` left the
snapshot matching, because the swapped attributes still reported `T` and `v`,
so Enter wrote the typed text into the other one. The Edit Attributes dialog's
stale-row check compared the same two fields and had the same weakness.

The snapshot now keeps the whole row, whose insertion point is the new
`AttributeRow::at`, and the dialog compares every property it shows, so both
paths refuse a reorder that only moves attributes.

A frame that finds another attribute in the field's place also takes no input:
text and Enter queued for that frame were meant for the attribute the field
had, so they neither commit nor become a pending buffer for the one there now.
The field draws the drawing's value, inert for that frame, and editing resumes
on the next.

Tests: equal tag and value attributes swapped under pending text write the
wrong attribute without the stronger comparison, in the Properties palette and
in the dialog; input queued for the frame that finds the row stale reached the
new row without the inert frame.
2026-11-23 17:34:00 +08:00
code-compliant fe10d3241a Properties: pending attribute text stays with its attribute (#1213)
A Properties attribute field is a place in the reference: `attedit` takes `at`
by index. The pending text was kept by drawing, reference and index alone, so a
reorder (`battman` order), a value edited from another path, or an undo that
put another attribute in that place handed the typed text to whichever
attribute was there. With attributes `[NO=7, NOTE=n]`: type into NOTE, run
`battman {"name":"Tag","action":"order","order":["NOTE","NO"]}` while it waits,
press Enter, and NO became `EG` while NOTE stayed `n`.

The pending text now carries the tag and value it was typed into. When the
place holds another attribute, the text is dropped, no `attedit` is sent, and
the command line says the value was not applied, as the dialog refuses a stale
row. An ordinary edit is unchanged, still one undo step.

Tests: a reorder, an edit from elsewhere and an undo under pending text each
write the wrong attribute without the snapshot check and change nothing with
it.
2026-11-23 15:50:57 +08:00
code-compliant 967c2d3111 attedit_dialog: a Properties attribute edit is one undo step (#2792)
The editor tests cover opening the dialog, drawing switches, repeated tags and
stale rows, but not a value typed into the Properties field reaching the
drawing and coming back with one Undo. This adds that case: type into NOTE,
press Enter, see the new value, undo, see the old one.

Test shape follows PR #2912's Properties edit and Undo test.
2026-11-23 12:38:22 +08:00
code-compliant 883eb6b65c Properties: an attribute tag keeps its own text, not the interface's
The Attributes group labelled its rows with prop_row, which looks the label up
in the interface catalogs: a tag such as `To` read as `A` in Spanish, and a tag
matching any other interface string changed the same way. A data_row helper
takes the label as it is, for drawing text, and keeps prop_row translated.

Test: attribute_tags_in_properties_are_not_translated fails without the helper.

The helper and the test shape follow PR #2912, which fixes the same label in
its Attributes group; this change does not bring that PR's xdata group.
2026-11-23 12:38:22 +08:00
code-compliant f7029901c1 Merge remote-tracking branch 'origin/main' into repair/1213-block-attribute-editing 2026-11-23 10:28:51 +08:00
FredApps a70b9b02e4 Merge pull request #1673 from ohagmann/feat/osnap-tab-every-candidate
Object snaps: Tab cycles every candidate snap under the cursor, not one per mode
2026-11-21 17:27:26 +07:00
FredApps b206eab39b Merge branch 'main' into feat/osnap-tab-every-candidate 2026-11-21 17:07:38 +07:00
Tanish Manku 8d3236c5a3 Merge pull request #3350 from storytold/stack/r2
Land #2763, #2905, #2918, #3233, #2804: tilted 2D polylines, mirrored heights on save, kept APPIDs, plot layout flags, Generate Boundary
2026-11-20 17:48:52 -07:00
Tanish Manku f4d4a6e4e1 DXF read: a thick polyline drawn as seen from above keeps the side of Z it extruded toward 2026-11-20 17:37:24 -07:00
Tanish Manku 80e9a97164 Merge main 2026-11-20 17:20:59 -07:00
Cody Vogt dd048358b6 Merge remote-tracking branch 'upstream/main' into feat/block-attribute-editing
# Conflicts:
#	crates/engine/tests/it/attedit_prompts.rs
#	crates/ui-egui/src/dialogs.rs
#	crates/ui-egui/src/i18n/uk.tsv
#	crates/ui-egui/src/menus.rs
2026-11-20 18:06:09 -06:00
Tanish Manku 97dccaf9e7 Merge pull request #3348 from storytold/docs/parity-batch-1120
Parity docs: batch for 2026-11-19 and 2026-11-20, alpha-blocker marks follow the six-row gate
2026-11-20 16:54:58 -07:00
Tanish Manku b39170aded HATCHGENERATEBOUNDARY: a mirrored hatch's boundary goes to its world height; the command is classified as using no files 2026-11-20 16:45:17 -07:00
Tanish Manku 20d489f059 ROADMAP: TRIM/EXTEND depth landed, drop it from Upcoming 2026-11-20 16:43:29 -07:00
Tanish Manku 318d8d9de1 Plot layout flag tests that save DWG opt in to the in-process bridge 2026-11-20 16:40:30 -07:00
Tanish Manku 4076a71dee Registered applications alone note no file version; the APPID tests that save DWG opt in to the in-process bridge 2026-11-20 16:40:26 -07:00
Tanish Manku e5a7d38a67 Merge #2804: Generate Boundary in a hatch's right-click menu (#2801) 2026-11-20 16:37:35 -07:00
Tanish Manku 46053d43c1 Merge #3233: save the plot layout flags as read (#3227) 2026-11-20 16:37:17 -07:00
Tanish Manku 6aa64fb5ae Merge #2918: a file's registered applications are kept when no xdata names them 2026-11-20 16:34:22 -07:00
Tanish Manku 543285778b Merge #2905: mirrored objects keep their world height and extrusion side 2026-11-20 16:34:00 -07:00
Tanish Manku fed8b0f4e4 Merge #2763: draw a tilted 2D POLYLINE as seen from above, like LWPOLYLINE 2026-11-20 16:33:50 -07:00
Tanish Manku 50baa3cfae Parity docs: batch for the merges of 2026-11-19 and 2026-11-20, alpha-blocker marks follow the six-row gate 2026-11-20 16:32:11 -07:00
Tanish Manku ef6df4dffa Merge pull request #3347 from storytold/stack/u8
Land #3313, #3300, #3316, #1873: arrowheads in DIMSTYLE, single-instance tests, Thai in the MTEXT editor, DIMPOST on angular dimensions
2026-11-20 16:31:01 -07:00
Tanish Manku 97c5670a0a Merge pull request #3346 from storytold/stack/s8
Land #2904, #3302, #3341, #1728, #2882, #1687, #3234: files other CAD programs refuse, and data lost on save
2026-11-20 16:30:51 -07:00
Tanish Manku ed294b3fb3 Single-instance tests: the skip note goes straight to stderr, where a passing test still shows it 2026-11-20 16:16:59 -07:00
Tanish Manku 40ddd7baca DWG bridge: an R2000 DWG keeps constraint groups and proxies as its reader takes them
The writer told the bridge from a DXF file by comparing the declared and the
target version, which are both R2000 for an R2000 DWG. Kept constraint groups
of a 2013+ drawing were then put in the old node order although the bridge
reads them as the version they came from, and kept proxies took the pre-2007
DXF layout. The bridge says so itself now. The render settings test module is
skipped where acadrust isn't built.
2026-11-20 16:12:50 -07:00
Tanish Manku ea4a59b662 Save warning: a DXF before 2013 that leaves out solids points to 2013 and later
Since #2882 a DXF of 2010 or earlier leaves out solids whose geometry only
the data store holds, and the interactive QSAVE asks before it does. The
warning's hint still said DXF 2010 and earlier keep them, which is the
version that loses them. The hint now depends on the version the file is
saved in: 2013 and later keep such solids, and the proxies a DXF before
2007 leaves out as well. Also rustfmt of the merged finish signature.
2026-11-20 14:23:07 -07:00
Tanish Manku 9e645ba17a Merge #3234: DXF: write kept proxies in the layout of the version written (#3229)
Conflicts with #2882 resolved: a DXF's loss report counts both what #2882
leaves out (solids whose ACIS geometry the version has no place for, in
either direction of 2013) and what #3234 leaves out before 2007 (proxies
whose strings it can't hold, with what goes with them), each named with its
own reason, for SAVE/SAVEAS, document.bytes, EXPORT, -WBLOCK and the
interactive QSAVE question. dxf_raw::finish takes both flags.
2026-11-20 14:22:04 -07:00
Tanish Manku 8da04230af Merge #1687: DXF/DWG save: kept render settings take the declared version's class-version form
Conflicts with main resolved: the source form is main's Foreign::version
(#2471), recorded at read time for the same reason, instead of the PR's own
Foreign::acadver. The conversion goes to the version the text is read as,
as #1728's constraint groups do: a DXF's own version, and for the DWG
bridge the version the kept objects came from, which craft-dwg's
encode_kept_noted declares, so there they stay as read. The DWG test opts
in to in-process DWG.
2026-11-20 14:20:07 -07:00
Tanish Manku af5c658a4b Merge #2882: Solids: no empty modeler records before 2013; list ACIS 4.0 SAT a DWG can't keep (#2334)
# Conflicts:
#	crates/io/src/dxf_write/sections.rs
2026-11-20 14:19:21 -07:00
Tanish Manku 5d76e47342 io tests: the constraint group DWG test opts in to in-process DWG and skips where acadrust isn't built
nextest runs each test in its own process, and the opt-in is process-wide,
so a DWG test calls it itself. acadrust is a dev-dependency only where
craft-dwg builds its native bridge (#2526), as the other DWG test files say.
2026-11-20 14:18:55 -07:00
Tanish Manku 3caad662a4 Single-instance length test uses its own folder; the angular DIMPOST DWG test builds on main and opts into the in-process DWG path 2026-11-20 14:18:52 -07:00
Tanish Manku 615fee3e12 Merge #1728: DWG: constraint groups keep their nodes 2026-11-20 14:18:36 -07:00
Tanish Manku 92fe0a655d io: the kept-data doc comment goes back on dxf_raw, not dwg_hatch 2026-11-20 14:18:33 -07:00
Tanish Manku a62dd047a4 Merge #1873: dim: apply the style's DIMPOST to angular dimensions (#1653) 2026-11-20 14:18:24 -07:00
Tanish Manku b4c325a36b Merge #3316: MTEXT editor: show Thai (and other drawing scripts) instead of boxes 2026-11-20 14:18:22 -07:00
Tanish Manku 1ad4fc7c91 Merge #3341: DWG: read a hatch's elliptic boundary edge angles as degrees (#3332) 2026-11-20 14:18:21 -07:00
Tanish Manku 8178a68f3e Merge #3300: Windows single-instance tests: short socket paths, skip when AF_UNIX can't bind (#3283) 2026-11-20 14:18:20 -07:00
Tanish Manku 29a22f7955 Save: a kept dimension block with another name keeps its record and description
A block with a name other than *D that an unedited dimension was read with
is written with the dimension blocks (#3302). Its BLOCK_RECORD lost its
insertion units and explodability there, and the BLOCK its description.
When that block is empty, the picture is regenerated in world coordinates,
so the block now goes at the origin rather than at the read base point,
which shifted the picture.

The new DWG-saving test of #3302 opts in to in-process DWG conversion.
2026-11-20 14:18:18 -07:00
Tanish Manku 48f0a590ab Merge #3313: Preserve per-end Closed filled arrowheads in DIMSTYLE 2026-11-20 14:18:18 -07:00
Tanish Manku 80f2b6838d Merge #3302: Save: an unedited dimension keeps its read block whatever the block's name (#3299) 2026-11-20 14:14:27 -07:00
Tanish Manku 70e55f21cc Merge #2904: DXF: a solid or gradient hatch no longer makes AutoCAD refuse the file 2026-11-20 14:13:38 -07:00
Tanish Manku d3af2d5077 Merge pull request #3345 from storytold/feat/text-edit-in-place
Double-click edits TEXT, attribute definitions and dimension text in place (#842)
2026-11-20 12:07:44 -07:00
Tanish Manku afcf5d3461 Start each in-place text box with no undo history
All boxes share one text field, so Ctrl+Z in a new box could bring back
the text typed into the last one; its undo history is cleared when a box
opens.
2026-11-20 11:45:44 -07:00
Tanish Manku 7ecf836de7 Keep an in-place text draft with the drawing it was typed in
The draft was keyed by the object's handle only, and handles repeat across
drawings; it is now also bound to the drawing's id, so it is never shown
or submitted for another drawing's object.
2026-11-20 11:45:44 -07:00
Tanish Manku 4b97a1a25e Size the in-place box of annotative text and dimensions as drawn
At a non-unit annotation scale an annotative TEXT, attribute definition or
dimension is drawn scaled; the editor box now takes its height, position
and extents from that scaled object, as the renderer and EXPLODE do.
2026-11-20 11:45:43 -07:00
Tanish Manku 4683023d94 Test the command line's IME at TEXT's prompt, which has no in-place editor
TEXTEDIT on a TEXT now edits it in place, so the IME goes into that box
(tested in text_double_click.rs); the command line's own IME handling is
tested where it still collects the text: TEXT's Enter text prompt.
2026-11-20 11:45:43 -07:00
Tanish Manku 44e0e431ee Make the in-place text box cover the text as drawn
The one-line editor was narrower than the text it edits: an egui area
caps its width, and a centred or right-justified text's box started at
its insertion point. TEXTEDIT now gives the editor the drawn text's
extents (TextEditor::extents, from the renderer's text placement), and
the box starts at the drawn left edge, is at least as wide and as tall as
the drawn text, and still grows as more is typed.
2026-11-20 10:56:18 -07:00
Tanish Mankuandsimanov 0b454bb536 Test that a double-clicked MTEXT is edited in its in-place editor
Double-clicking an MTEXT opens the editor with its contents; what is typed
is kept with Ctrl+Enter. Carried from #1425.

Co-authored-by: simanov <asimfali@mail.ru>
2026-11-20 10:40:08 -07:00