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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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>