fix(color): show color book identity

This commit is contained in:
Hakan Seven committed 2026-09-01 08:44:28 +03:00
1 parent 7ea4f338f6
commit 6d6defa0ad
19 files changed
+142 -30

No files matched your search

+2
View File
@@ -260,6 +260,8 @@ fn blend_common(source: &EntityCommon) -> EntityCommon {
let mut common = EntityCommon::new();
common.layer = source.layer.clone();
common.color = source.color;
common.color_name = source.color_name.clone();
common.color_book_handle = source.color_book_handle;
common.line_weight = source.line_weight;
common.linetype = source.linetype.clone();
common.linetype_handle = source.linetype_handle;
+4
View File
@@ -714,6 +714,8 @@ fn dim_common(base: &acadrust::entities::EntityCommon, clr: i16, lw: i16) -> aca
c.handle = Handle::NULL;
if clr != 0 && clr != 256 {
c.color = acadrust::types::Color::from_index(clr);
c.color_name = None;
c.color_book_handle = None;
}
if lw >= 0 {
c.line_weight = acadrust::types::LineWeight::from_value(lw);
@@ -1223,6 +1225,8 @@ fn explode_dimension(dim: &Dimension, doc: &CadDocument) -> Vec<EntityType> {
// Apply the text colour / lineweight (DIMCLRT) onto the entity.
let tc = dim_common(&base.common, met.dimclrt, -2);
tent.common_mut().color = tc.color;
tent.common_mut().color_name = tc.color_name;
tent.common_mut().color_book_handle = tc.color_book_handle;
tent.common_mut().line_weight = tc.line_weight;
result.push(tent);
}