From 2ee1c8e19699aef30c8ed2803772d9a8d4d6f3d8 Mon Sep 17 00:00:00 2001 From: Hakan Seven Date: Fri, 24 Apr 2026 01:43:13 +0300 Subject: [PATCH] fix: entity_type_label/key in helpers.rs cover all EntityType variants The Properties panel header was still showing "Entity" for unrecognized types because helpers.rs had its own incomplete match. Both functions now enumerate every acadrust EntityType variant explicitly. Co-Authored-By: Claude Sonnet 4.6 --- src/app/helpers.rs | 88 ++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 73 insertions(+), 15 deletions(-) diff --git a/src/app/helpers.rs b/src/app/helpers.rs index 32338a327..203ffa7e5 100644 --- a/src/app/helpers.rs +++ b/src/app/helpers.rs @@ -155,38 +155,96 @@ pub(super) fn next_group_auto_name(scene: &crate::scene::Scene) -> String { pub(super) fn entity_type_label(entity: &acadrust::EntityType) -> String { use acadrust::EntityType::*; match entity { + Point(_) => "Point", Line(_) => "Line", Circle(_) => "Circle", Arc(_) => "Arc", Ellipse(_) => "Ellipse", Spline(_) => "Spline", LwPolyline(_) => "Polyline", + Polyline(_) => "Polyline", + Polyline2D(_) => "Polyline2D", + Polyline3D(_) => "Polyline3D", + PolyfaceMesh(_) => "PolyfaceMesh", + PolygonMesh(_) => "PolygonMesh", Text(_) => "Text", MText(_) => "MText", Dimension(_) => "Dimension", + Leader(_) => "Leader", + MultiLeader(_) => "MultiLeader", + Tolerance(_) => "Tolerance", Insert(_) => "Block Reference", - Point(_) => "Point", + Block(_) => "Block", + BlockEnd(_) => "Block End", Hatch(_) => "Hatch", - _ => "Entity", + Solid(_) => "Solid", + Face3D(_) => "3D Face", + Solid3D(_) => "3D Solid", + Region(_) => "Region", + Body(_) => "Body", + Mesh(_) => "Mesh", + Ray(_) => "Ray", + XLine(_) => "XLine", + MLine(_) => "MLine", + Viewport(_) => "Viewport", + RasterImage(_) => "Raster Image", + Wipeout(_) => "Wipeout", + Underlay(_) => "Underlay", + Shape(_) => "Shape", + Table(_) => "Table", + AttributeDefinition(_) => "Attribute Definition", + AttributeEntity(_) => "Attribute", + Ole2Frame(_) => "OLE Frame", + Seqend(_) => "Seqend", + Unknown(_) => "Unknown", } .to_string() } pub(super) fn entity_type_key(entity: &acadrust::EntityType) -> String { + use acadrust::EntityType::*; match entity { - acadrust::EntityType::LwPolyline(_) => "pline", - acadrust::EntityType::Circle(_) => "circle", - acadrust::EntityType::Line(_) => "line", - acadrust::EntityType::Arc(_) => "arc", - acadrust::EntityType::Ellipse(_) => "ellipse", - acadrust::EntityType::Spline(_) => "spline", - acadrust::EntityType::Text(_) => "text", - acadrust::EntityType::MText(_) => "mtext", - acadrust::EntityType::Dimension(_) => "dimension", - acadrust::EntityType::Insert(_) => "insert", - acadrust::EntityType::Point(_) => "point", - acadrust::EntityType::Hatch(_) => "hatch", - _ => "entity", + Point(_) => "point", + Line(_) => "line", + Circle(_) => "circle", + Arc(_) => "arc", + Ellipse(_) => "ellipse", + Spline(_) => "spline", + LwPolyline(_) | Polyline(_) => "pline", + Polyline2D(_) => "pline2d", + Polyline3D(_) => "pline3d", + PolyfaceMesh(_) => "polyface", + PolygonMesh(_) => "polymesh", + Text(_) => "text", + MText(_) => "mtext", + Dimension(_) => "dimension", + Leader(_) => "leader", + MultiLeader(_) => "multileader", + Tolerance(_) => "tolerance", + Insert(_) => "insert", + Block(_) => "block", + BlockEnd(_) => "blockend", + Hatch(_) => "hatch", + Solid(_) => "solid", + Face3D(_) => "face3d", + Solid3D(_) => "solid3d", + Region(_) => "region", + Body(_) => "body", + Mesh(_) => "mesh", + Ray(_) => "ray", + XLine(_) => "xline", + MLine(_) => "mline", + Viewport(_) => "viewport", + RasterImage(_) => "rasterimage", + Wipeout(_) => "wipeout", + Underlay(_) => "underlay", + Shape(_) => "shape", + Table(_) => "table", + AttributeDefinition(_) => "attdef", + AttributeEntity(_) => "attrib", + Ole2Frame(_) => "ole2frame", + Seqend(_) => "seqend", + Unknown(_) => "unknown", } .to_string() }