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 <[email protected]>
This commit is contained in:
Hakan SevenandClaude Sonnet 4.6 committed 2026-04-24 01:43:13 +03:00
1 parent a5057e26b1
commit 2ee1c8e196
1 file changed
+73 -15
+73 -15
View File
@@ -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()
}