feat(props): make dim-line colour editable for leaders and dimensions

The "Dim line color" row on Leader and Dimension entities was
read-only: an earlier attempt wired it to Leader.override_color, which
acadrust never serialises, so the pick was lost on save. Store it
instead as a standard ACAD_DSTYLE per-object dimension-style override
(DXF code 176, an ACI index) through the existing dim_override codec,
so it round-trips through both DWG and DXF like the other dim
overrides. RGB picks collapse to the nearest ACI, matching the rest of
the dim-colour stack (dimension styles are index-only through the file
layer). The renderer prefers the override over the style's DIMCLRD.

The write branch is guarded to leaders and dimensions so a mixed
selection cannot stamp the override onto other entity types.

Bumps acadrust to c9fe982, which carries parsed XDATA onto dimensions
on DXF read (it was dropping common.extended_data), so the dimension
override persists on DXF save as well as DWG.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
This commit is contained in:
Hakan SevenandClaude Opus 4.8 committed 2026-07-13 17:31:09 +03:00
1 parent 04bd49c715
commit d005cc4ab1
8 files changed
+241 -29

No files matched your search

+17 -7
View File
@@ -434,18 +434,28 @@ impl PropertiesPanel {
);
return prop_row_widget(label, selector);
}
// Generic per-field colour picker (hatch gradient colours) — routes to
// the field, not the entity's main colour.
if field == "gradient_color_1" || field == "gradient_color_2" {
// Generic per-field colour picker — routes to the named field, not the
// entity's main colour. Used by hatch gradient colours and the dim-line
// colour override (Leader / Dimension). Dim colours legitimately take
// ByLayer / ByBlock; gradient colours do not.
if field == "gradient_color_1" || field == "gradient_color_2" || field == "dim_line_color" {
let open = self.open_color_field.as_deref() == Some(field);
let fsel = field.to_string();
let selector = crate::ui::color_select::color_selector(
color,
open,
let extras = if field == "dim_line_color" {
crate::ui::color_select::ColorExtras {
by_layer: true,
by_block: true,
}
} else {
crate::ui::color_select::ColorExtras {
by_layer: false,
by_block: false,
},
}
};
let selector = crate::ui::color_select::color_selector(
color,
open,
extras,
move |c| Message::PropColorFieldChanged {
field: fsel.clone(),
color: c,