Commit Graph
1455 Commits
Author SHA1 Message Date
code-compliantandClaude Fable 5.2 5f751ee30d AutoLISP: entnext reaches an INSERT's ATTRIBs and SEQEND (#1660) (#3396)
* AutoLISP: entnext reaches an INSERT's ATTRIBs and SEQEND (#1660)

- lisp: name an INSERT's ATTRIB and SEQEND records; entnext walks them, then the next main
  entity, and entget lists a record with its owner in group -2 (#1660)
- lisp: entmod of an ATTRIB takes its value (group 1) only, as one undo step; another property,
  a SEQEND, entdel and entmake of one return nil and change nothing (#1660)
- doc: the handles LISP named, shared with the drawing's snapshots and never given out by
  new_handle; 65,536 names, 1,024 probes past taken handles (#1660)
- io: entity_sub_record, one record of an INSERT at a time, never its other records (#1660)
- engine: an optional host hook for that record, so EntityCodec is unchanged (#1660)
- cli, web, app: install the hook; CLI tests for the walk, the value edit, the name bounds and
  the refusals (#1660)
- docs: autolisp.md on the records, their names, when a name ends, and the value-only edit (#1660)
- reused from #1753 (closed), with thanks: the entity_list extraction with the -2 owner, the
  writer's record splitting, and the entnext_walks_an_inserts_attribs test skeleton

* Keep AutoLISP's attribute names within their drawing

- Hold an INSERT's attribute names in the session's LISP state, not in
  cadcraft_doc::Drawing: comparing drawings is plain data again and takes no
  lock. The session reserves the handles in the drawing before any change, so
  new_handle still never gives one out, also after a drawing swap.
- End the names when the Block Editor closes: its drawing starts from the
  host's handles, so a name given there must never resolve to a host record.
- End only the erased reference's names on ERASE. Erasing another object
  leaves an attribute name holding, and OOPS still revives none.
- Go on to the next entity when an INSERT has no record provider installed.
- Refuse an ATTRIB edit whose outer list ends in an atom.

* Keep issued attribute names out of the drawing.

A copied drawing could reuse a name, and storing the names in the drawing marked a saved drawing changed.

* Name an INSERT's ATTRIBs and SEQEND apart from drawing handles

An ATTRIB or SEQEND has no handle of its own in the drawing, so the
name AutoLISP gives it is now a value of its own (an entity name for
`type`), numbered from one count for the whole process that never
gives a number twice. No handle of any drawing, of a copy of one, of
another session or of another thread can be such a name, so nothing
is reserved in the handle space any more: cadcraft-doc, `new_handle`
and the copy-then-install paths are as on main, and naming or reading
a record changes neither the drawing nor its saved state.

What a name stands for (reference, place, tag) stays in the engine's
LISP state, by document. Names end on Undo, Redo, ATTSYNC,
-BLOCKREPLACE, on opening and closing the Block Editor, and when a
change is taken back; erasing a reference ends only its names, and
OOPS or `entdel` bringing it back revives none. `entupd` of a record
answers its name; selection sets and `command` take no record.

Tests cover other sessions, documents and threads giving out handles
in a drawing copy, the copy paths (INSERT from a file, XATTACH, AUDIT,
REFCLOSE), and the AutoLISP behaviour of the names.

* Keep one ATTDEF index per state of a block's entities

EntityStore gets a content token: a clone has its store's, and every
edit gives the store one that no store has had. The DXF writer keys
its ATTDEF index on that token and keeps the indexes of several
blocks, up to a fixed number of tags in all. Two copies edited apart,
or a different edit after Undo, never read each other's definition
properties, in AutoLISP reads or in a saved file, and reads that
alternate between references of different blocks examine each
definition once.

* End record names when a command puts an earlier drawing back.

MOCORO Undo restored its history drawing, handle seed included, so the next Copy could reuse the removed reference's handle. That restore now advances the name epoch. An ATTDEF index that would pass the tag budget is not stored.

* Match an oversized ATTDEF definition in full and remember it is too large to index

* Count record names with try_update, not the deprecated fetch_update

Rust 1.100 deprecates fetch_update and names try_update in its place, so
clippy with -D warnings stopped the gate at RecordName::fresh. It is the
same operation: the checked increment and the None once the count runs
out are unchanged. try_update compiles on Rust 1.95, the workspace's
minimum.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>

* Record tests check the objects they rely on

Five tests could pass without the state they are about.

The two ATTDEF index tests changed only a layer, so both states of the
block gave T the same handle, and an index kept for the wrong state
still read the right layer. One state now keeps T on the first ATTDEF
and the other passes T to the second, on another layer. With one index
shared by every store, the old tests passed and these fail.

The MOCORO and grip Copy tests did not check that a copy was made, or
that the copy after the Undo took the removed copy's handle. They now
check both, and that the name read the first copy before the Undo.

The walk at the top of the handle range compared two values that are
both nil when the line at FFFFFFFFFFFFFFFF is not in the drawing. It
now reads that line first.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>

* Test that entdel preserves unrelated ATTRIB names

* Fix AutoLISP record lifetime and REFEDIT edits

* Run attribute name cases in engine integration suite

* Fix text fixtures after main merge

---------

Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
2026-12-02 00:34:42 +01:00
FredApps 0f7940a986 test: count attribute tag matching work instead of timing it (#3723) 2026-12-01 17:37:27 +01:00
a79b9feca9 feat(doc,io,render): support MTEXT background mask (DXF 90/63/421/45) (#3240)
* feat(mtext): support MTEXT background mask (DXF 90/63/421/45) in doc, io, and render

* fix(mtext): write background mask before column tags and use Autodesk border offset factor

* fix(render): resolve ByLayer/ByBlock for MTEXT background mask and guard non-finite rotation

* fix(render/mtext): cover overflowing glyphs, MLeader text opt, and attrib ByBlock bg

* fix(io/dxf): omit inactive MTEXT background mask conditional tags

* Fix MTEXT background test for current Text fields

Signed-off-by: FredApps <153173854+FredApps@users.noreply.github.com>

---------

Signed-off-by: FredApps <153173854+FredApps@users.noreply.github.com>
Co-authored-by: vantruong-dang <vantruong-dang@users.noreply.github.com>
Co-authored-by: FredApps <153173854+FredApps@users.noreply.github.com>
2026-12-01 12:50:47 +01:00
b778851b48 Viewports keep their own UCS and their other settings through save and copy (part of #1316) (#1484)
* Viewports keep their own UCS and their other settings through save and copy (part of #1316)

A layout viewport's own UCS and every setting CADCraft doesn't model
were dropped on read, so saving a sheet set lost them for good.

- Viewport::ucs (origin, X/Y axes, elevation, orthographic type, named
  and base UCS by name) and ucs_per_viewport (UCSVP), read from and
  written as VIEWPORT groups 110-112, 146, 79, 345/346 and 71.
- Viewport::extra: the viewport's other groups as read (snap, grid,
  lens and clipping, render mode, plot style sheet, shade plot, visual
  style, background, lighting). They belong to the entity, so COPY and
  MIRROR carry them; dxf_raw::finish writes them before the xdata and
  points their references at what they named (ForeignExtra::tail).
- Not carried raw: the view twist, direction and target (51, 16, 17),
  which say where the view centre is measured from; writing them back
  while the centre is in drawing coordinates would move the view.
- DWG: the bridge drops 345/346, the plot style sheet, shade plot and
  lighting groups, so CADCraft xdata keeps a copy (VPUCS, VPEXTRA) that
  the reader falls back on. The visual style, background and shade plot
  references are still lost through DWG (file-format-parity.md).
- A UCS with unreadable or zero-length axes is no UCS; a named UCS
  that's no longer in the table isn't pointed at.

Tests: another program's viewport read; DXF save and reread; two DWG
round trips; a copied viewport; a deleted named UCS; a viewport without
a UCS written as before; hostile groups (5000 extras, NaN axes, bad
handles); COPY and MIRROR through the engine.

* Viewports: VPEXTRA keeps only a viewport's own groups; a base UCS handle alone is kept

- CADCraft's VPEXTRA xdata copy of a viewport's unmodelled groups is
  merged only for groups that can stand inside the AcDbViewport subclass:
  a record start (0), handles (5, 105), a subclass (100), a group brace
  (102) or xdata (1000 on) from a crafted file are dropped, so a save
  can't write records or handles the user didn't draw.
- A VIEWPORT whose only UCS group is its base UCS handle (346) now reads a
  UCS, so the base UCS is resolved and written back.

* Viewports: drop structural groups from a record's own extras; index UCS names for the xdata fallback

- A VIEWPORT's own AcDbViewport groups are kept raw only when they can
  stand in the subclass, as CADCraft's VPEXTRA copy already was: a second
  handle (5, 105) or a group brace (102) written back would give the
  record two handles. The record's own pointer groups stay, to be
  remapped with it.
- The named and base UCS that CADCraft's xdata names are looked up in a
  case-insensitive index built once with the UCS table, not by scanning
  every UCS for each viewport.

* Parity checklist: regenerated after merging main

* Parity checklist: regenerated after merging main

* Parity checklist: regenerated after merging main

* xtask: take main's stats.rs (the merge kept a test import Linux clippy rejects)

* Viewport tests built on main set the UCS fields

* WIP row 74: Codex's test edits kept; production normalisation (identity UCS -> None, default-valued extras dropped in dxf_read viewport_ucs/viewport_extra) still to do

* Viewports: a default viewport reads back with no UCS or extra groups (#1484)

A DWG save writes an identity UCS and the default snap, grid, lens, clip,
render and shade groups for every viewport, so a viewport nobody gave a UCS
came back with one and a dozen extras. The DXF reader now reads an unnamed
identity UCS (UCSVP 0) as none, and keeps a group in extra only when it
differs from the defaults, listed in one table. Tests: a_default_viewport_reads_back_without_ucs_or_extras,
a_viewport_with_non_default_snap_keeps_it; layouts_and_paperspace passes.

* Viewports: clippy range patterns; raster_image test builds with the viewport's UCS fields

* Tests: move the viewport UCS suites into the it entry points (#1316)

viewport_ucs_roundtrip.rs and viewport_ucs_copy.rs were separate test
binaries; AGENTS section 30 wants the existing entry points. All 12 DXF/DWG
persistence tests and the COPY/MIRROR tests are kept.

* Tests: move the viewport UCS suites into the it entry points (#1316)

viewport_ucs_roundtrip.rs and viewport_ucs_copy.rs were separate test
binaries; AGENTS section 30 wants the existing entry points. All 12 DXF/DWG
persistence tests and the COPY/MIRROR tests are kept.

---------

Signed-off-by: FredApps <153173854+FredApps@users.noreply.github.com>
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: SBaksa <18648812+SBaksa@users.noreply.github.com>
Co-authored-by: FredApps <153173854+FredApps@users.noreply.github.com>
2026-12-01 12:16:30 +01:00
e6bbf59c31 Expose xdata through entities, properties.set and AutoLISP's -3 group (#2469)
* Expose xdata through entities, properties.set and AutoLISP's -3 group

An entity's extended data was read, kept and written back (#528) but
invisible to the API: `entities` left it out, `properties.set` had no
field for it, `entget` never returned the -3 group and `entmod` dropped
it. Now `entities {xdata: true | "APP"}` and `properties` list it per
application with values typed by group code, `properties.set {xdata}`
replaces or removes one application's data after checking codes,
values, braces and sizes, and AutoLISP's entget/entmod/entmake carry
the -3 group, with `regapp` and the APPID table. The applications
CADCraft writes from its own model are reserved (one list, now in
cadcraft_doc, shared with the DXF reader).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

* Check xdata before any change in properties.set; cap entmake's xdata across applications

Review follow-ups on #2469:
- properties.set validated xdata after ensure_layer, so a request naming a new
  layer and carrying bad or oversized xdata left the layer behind on failure.
  The xdata checks now run first.
- entmake capped each application's groups but not their sum; an entity could
  exceed MAX_XDATA_GROUPS across applications. The total is checked as entmod
  already does, with a test.
- docs: the control-protocol xdata section is an h2 like its neighbours; the
  file-format-parity revision row no longer has a pipe inside a code span.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

* properties.set checks every handle first; a dotted -3 group is a bad list

Review follow-ups on #2469:
- properties.set edited the objects before a handle that names nothing and
  then failed, keeping those edits (and a new layer). Every handle is checked
  before anything changes; a missing one is refused with its hex.
- xdata_from_list read `(-3 . 7)` as "no applications" and let entmake/entmod
  succeed with nothing set. A -3 whose cdr is not a list is refused (listp),
  so both return nil as for any bad list.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

* An xdata application's groups must be a proper list

Review follow-up on #2469: `("ACME" . 7)` in a -3 group read as "no groups",
which `entmod` takes as "remove ACME's data", and a dotted tail after real
groups was dropped. The application's tail is checked as a list (listp) like
the -3 group itself, so entmake/entmod answer nil and change nothing; test
covers both shapes.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

* Runs of one xdata application in any case are one application in the API

Review follow-up on #2469: a file can carry `ACME` and `acme` runs on one
entity. `entities` showed them as two JSON keys and `entget` as two lists, and
writing either back through properties.set or entmod replaced the application
twice, keeping only the last run's groups. Both projections now merge runs
case-insensitively (first spelling, all the groups), as set_xdata_app already
treats them; tests round-trip such an entity through both APIs.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

* Refuse raw ACAD xdata on a dimension, whose ACAD run is written from its overrides

Review follow-up on #2469 (austin62jake): properties.set accepted
`xdata: {"ACAD": …}` on a dimension and `entities` showed it, but the DXF
writer emits the dimension's ACAD run (DSTYLE) from its overrides and the
reader models it back, so the raw groups vanished on save. ACAD can't join
RESERVED_XDATA_APPS (files carry ACAD data on other entities that CADCraft
keeps raw), so the rule is per entity: `is_model_xdata_app(name, kind)` is
the reserved list on any entity plus ACAD on a dimension. properties.set
refuses it before anything changes, entmake/entmod answer nil. Tests cover
both paths, including that ACAD on a line survives a DXF round trip and the
dimension's own override does too. control-protocol.md says so.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

* fix(lisp): return and accept REAL for xdata group 1071

---------

Signed-off-by: FredApps <153173854+FredApps@users.noreply.github.com>
Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
Co-authored-by: FredApps <fredapps@users.noreply.github.com>
Co-authored-by: FredApps <153173854+FredApps@users.noreply.github.com>
2026-12-01 11:38:34 +01:00
FredApps e928d57182 Sync current main into annotative block contexts 2026-12-01 09:39:20 +01:00
Tanish Manku 34d52cd336 Merge #3404: Block attributes: Attribute Editor and Properties attributes (repair of #1213) 2026-11-30 20:46:21 -07:00
Tanish Manku f2733ade72 Merge #3039: INSERT of a drawing file does not ask to redefine its block when EXPERT is 2 or more 2026-11-30 20:46:19 -07:00
Tanish Manku 4f2800a0dc Landing fix: the two TEXT literals #3214 added take #3679's new fields 2026-11-30 18:52:32 -07:00
Tanish Manku 69e7b40762 Merge #3679: TEXT's own Backwards and Upside down (DXF 71 generation flags) 2026-11-30 18:44:56 -07:00
Tanish Manku 9cf855c55e Merge #3232: Save As and Export: write DXF and DWG at the chosen version (#3213) 2026-11-30 18:43:54 -07:00
Tanish Manku 5d7f8b62d9 Merge #3259: RECTANG: Dynamic Input asks for the other corner as X and Y (#3258) 2026-11-30 18:43:52 -07:00
Tanish Manku fe83a26af5 Merge #3221: fix(engine): frame layout extents on initial tab switch (#3219) 2026-11-30 18:43:48 -07:00
Tanish Manku 3b4ee98570 Merge #3617: trim/extend: Shift toggles mode with live preview (partial #3569) 2026-11-30 18:43:44 -07:00
Tanish Manku ace5d48da1 Merge #3625: MOVE and COPY: a perpendicular or tangent base point resolves from the second point (#3481) 2026-11-30 18:43:43 -07:00
Tanish Manku 719bdee804 Merge #3583: SCALE: a factor point on the base point re-prompts instead of ending the command (fixes #3475) 2026-11-30 18:43:41 -07:00
Tanish Manku a1927ea897 Merge pull request #3692 from storytold/stack/e2
Land #3630, #3659, #3660, #3661, #3646, #3651, #3642, #3519, #3288, #3685, #3609, #3214, #3540, #3594, #3622: LISP and script fixes, graphics start-up fallback, render budgets, solver speed, viewport selection
2026-11-30 17:12:22 -07:00
CTGControlsandClaude Opus 5.5 7d9225c856 SCALE: the factor-point check uses require_length (#3475)
The point arm repeated require_length's check and message inline; it now
calls the helper, as the Reference length already does, so the two paths
keep one threshold and one error.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-30 16:23:12 -06:00
Tanish Manku 23f60b50aa Merge pull request #3689 from storytold/stack/p2
Land #3483, #3672, #3520, #3613, #3611, #3610, #3647, #3668, #3670: proxy graphics follow-ups, hatch derived bit, covered cell text, layer 0 attributes, WIPEOUTFRAME, layout flags
2026-11-30 13:51:50 -07:00
paco-velascoandClaude Fable 5.2 318cfc83fa Merge main into fix/text-generation-flags-read
Keeps both sides in text_box (main's fitted height and rotation, this
branch's mirroring) and sets the two flags on the Text literals main
has added since.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-30 21:31:20 +01:00
Tanish Manku 0589527c4c Merge #3214: Selection through a viewport leaves out block parts on its frozen layers (#3126) 2026-11-30 13:24:55 -07:00
Tanish Manku d9be0f6350 Merge #3288: fix(cmd): support SCALE Reference Points/Copy and grip height scaling 2026-11-30 13:24:49 -07:00
Tanish Manku 3f30859e0c Merge #3519: HATCH from a LISP (command) call takes the command-line answer order 2026-11-30 13:24:47 -07:00
Tanish Manku 66bca62c73 Merge #3642: fix(engine, mcp): run a script's LISP routine on before its next input 2026-11-30 13:24:38 -07:00
Tanish Manku f52bd37893 Merge #3651: fix(engine, mcp, ui): keep a request's output when the command history trims 2026-11-30 13:24:36 -07:00
Tanish Manku 80bccfca4f Merge #3646: fix(cmdline): insert spaces inside unclosed AutoLISP expressions (#3632) 2026-11-30 13:24:34 -07:00
Tanish Manku 95ce89b7dd Merge #3661: MTEXT: honor paragraph line spacing codes (\pxsm, \pxse, \pxsd) (#3638) 2026-11-30 13:24:32 -07:00
code-compliant c8995ac18b Merge origin/main into repair/1213-block-attribute-editing 2026-12-01 04:22:46 +08:00
kc8a c9277f90e0 Merge branch 'main' into feat/trim-extend-shift
# Conflicts:
#	crates/engine/tests/it/trim_highlight.rs
2026-11-30 20:21:12 +00:00
Tanish Manku 080ae3110d Merge pull request #3690 from storytold/stack/e1
Land #3504, #3506, #3526, #3513, #3586, #3612, #3615, #3624, #3571, #3584, #3587: TRIM/EXTRIM follow-ups, table paste follow-ups, text extents, palette and grip fixes
2026-11-30 13:11:59 -07:00
Tanish Manku b1345be253 Merge pull request #3352 from storytold/land/2355
Land #2355: REFEDIT edits an xref in place and writes it back to its file
2026-11-30 13:02:05 -07:00
FredApps 7068bf9464 Merge current main into deferred MOVE/COPY snapping
Preserve the canonical SCALE reference preview and drag behavior when resolving select_then.rs.
2026-11-30 20:41:08 +01:00
Tanish Manku 47372d358a Merge #3587: repeat pastetable on Enter with the last pasted text 2026-11-30 12:30:45 -07:00
Tanish Manku bdf4f65be9 Merge #3584: fix(render,table): wrap long TABLE cell text at column width (#3488) 2026-11-30 12:30:17 -07:00
Tanish Manku 989541c198 Merge #3624: Grips: a closed spline has one grip per control vertex and stays closed when it is dragged (#3566) 2026-11-30 12:30:13 -07:00
Tanish Manku bf715ddc44 Merge #3526: TRIM preview and EXTRIM: follow-ups from the landing review of #3382 and #2808 2026-11-30 12:30:02 -07:00
Tanish Manku 461be33ea8 Merge #3668: fix(io): save each layout's own LAYOUT flags (PSLTSCALE, LIMCHECK) instead of 1 2026-11-30 12:29:50 -07:00
Tanish Manku d1fbec9473 Merge #3613: An attribute set on layer 0 stays on layer 0 on save and in the drawing (#3492) 2026-11-30 12:29:42 -07:00
Tanish Manku 9cedb46d53 Merge #3520: DXF: keep covered table cell text through 2007 and later saves 2026-11-30 12:29:40 -07:00
Tanish Manku 8c4875606f REFCLOSE: a reference to an xref of the host is refused even when the file has a block of that name; U inside a routine stops at a save that wrote the file 2026-11-30 12:19:08 -07:00
Tanish Manku a5289ffffa Merge main 2026-11-30 12:18:08 -07:00
Tanish Manku d52b505afc Merge branch 'main' into land/3288 2026-11-30 12:16:38 -07:00
kc8a 544dea24d1 trim/extend: Shift toggles mode with live preview (partial #3569)
Holding Shift during TRIM/EXTEND temporarily switches to the opposite command (standard CAD behavior). Session.shift_down is written by the UI and TrimM uses extend XOR shift_down for execution, prompt, Fence/Crossing preview and the single-entity rollover preview. The UI repaints and the preview cache key includes shift/ctrl, so a modifier-only change refreshes the preview.

BLOCK/INSERT geometry is still ignored as cutting/boundary edges in TRIM/EXTEND; that remains for a follow-up.
2026-11-30 18:32:57 +00:00
Ray 50d2fd0c77 Save As and Export: write DXF and DWG at the chosen version (#3213)
EXPORT ignored the version and always wrote the version the drawing was
read in, and the Save dialog passed the Default Save Format version only
for drawings with no file yet, so an opened 2013 DXF could not be written
as 2000.

EXPORT now takes SAVEAS's version and binary options for DXF and DWG
(other formats refuse them). The Save and Export dialogs share one helper
that passes the Default Save Format version for every .dxf or .dwg path,
an opened drawing's too. An export leaves the drawing's own version and
name alone, and QSAVE still keeps the file's version.

The message shown when the version is picked names Save As and Export
and goes through the translation system.
2026-11-30 05:22:50 -07:00
Ray 820b78d690 MOVE and COPY: a perpendicular or tangent base point resolves from the second point (#3481)
The base point prompt opts in to deferred PER and TAN snaps. The pick waits for
the second point, which resolves the base with snap::resolve_deferred, as LINE's
first point does, then moves or copies by second point minus that base. COPY
keeps the resolved base for later copies.
2026-11-30 05:19:07 -07:00
Ray f9c1aab173 RECTANG: Dynamic Input asks for the other corner as X and Y (#3258)
The other corner of a rectangle is its size, so the reference
application shows width and height boxes there whatever DYNPIFORMAT
says. CADCraft followed DYNPIFORMAT, so with the default polar format
40 Tab 30 placed the corner 40 units away at 30 degrees.

A prompt can now ask for X and Y (Prompt::xy), and RECTANG's other
corner does.
2026-11-30 05:16:51 -07:00
garvitrakhecha a323e94b69 fix(cmdline): insert spaces inside unclosed AutoLISP expressions (#3632) 2026-11-30 15:50:07 +05:30
paco-velascoandClaude Fable 5.2 d80c4cb39f Text generation flags: the Text literals main has added since
Proxy graphics text, PDF import text and dynamic block grip text are built without Backwards or
Upside down; four tests build Text the same way.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-30 09:27:11 +01:00
SlopapaloozaandClaude Opus 5.5 34301df312 Review fixes: multiline attributes' 71; justified text's DXF start by its own flags
From CodeRabbit's reviews of #1136:
- TEXT's generation flags are AcDbText's group 71, but ATTDEF and ATTRIB
  read the first 71 among all their groups. A multiline attribute's
  AcDbAttribute / AcDbAttributeDefinition subclass has a 71 of its own (its
  multiline flag: 2 for an attribute, 4 for a definition), which AutoCAD and
  CADCraft write when the text has no generation flags, so multiline
  definitions read upside down and multiline attributes backwards (and were
  saved so). Only the groups before the attribute subclass give the flags
  now; the multiline fixture checks it, read and saved again.
- The start of a justified TEXT's baseline (DXF group 10) is worked out with
  the text's own Backwards and Upside down, as it's drawn and as its group
  71 says; it took the style's.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-30 09:19:23 +01:00
SlopapaloozaandClaude Opus 5.5 c6016720ee TEXT's own Backwards and Upside down (DXF 71 generation flags)
TEXT, ATTDEF and ATTRIB have their own Backwards and Upside down, as AutoCAD's do (DXF group
71: 2 backwards, 4 upside down). New TEXT and attribute definitions take them from their style;
changing the style afterwards leaves existing text as it is. They were the style's only, so
text read from a file with its own flags was drawn as its style said.

- Model: `Text::backwards` and `Text::upside_down` (serde default false).
- DXF: read from 71 (the object's own groups, before an embedded MTEXT) and written when set.
- Render: drawn from the text's flags; the extents box mirrors with them, so zooming to
  extents frames mirrored text. Linetype text keeps its style's.
- Properties: a Misc group with Upside down and Backwards (`properties.describe`, and
  `properties.set` takes `backwards` and `upsideDown`), for several texts at once with *VARIES*.
- ATTDEF builds its text as TEXT does, so it also takes the style's width factor and obliquing.
- Round trip: #2237's matrices compare both flags, with DXF and DWG cases for them. Its
  mirrored-style cases mirror the text by the text's own flags, and each mirrored style
  also has text whose flags differ, so a style's flags can't leak into its text's.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-30 09:19:23 +01:00