Closed jpirnay closed 1 week ago
This PR fixes an issue with delayed tree item label updates for break subpath operations. The implementation changes how node attributes are stored and handled during subpath creation, switching from a list-based to a dictionary-based approach. It also adds proper attribute initialization during subnode creation and implements element property reload signaling for affected groups.
sequenceDiagram
participant User
participant System
participant Node
participant GroupNode
participant SubNode
User->>System: Initiate element_subpath
System->>Node: Iterate over data nodes
Node->>System: Provide node attributes
System->>GroupNode: Replace node with group node
System->>Node: Check for final_geometry
Node-->>System: Return geometry
System->>System: Iterate over subpaths
System->>SubNode: Add subnode with attributes
System->>System: Append subnode to elems
System->>GroupNode: Append group node to elements_nodes
System->>System: Signal element_property_reload
System->>User: Return elements and nodes
classDiagram
class Node {
-label: String
-attributes: Dict
+replace_node(type, label)
+final_geometry()
}
class GroupNode {
+add(geometry, type, label, stroke, fill)
}
class SubNode {
+setattr(key, value)
}
Node --> GroupNode : replace_node
GroupNode --> SubNode : add
SubNode --> Node : setattr
Change | Details | Files |
---|---|---|
Refactored node attributes storage from list to dictionary |
|
meerk40t/core/elements/branches.py |
Enhanced subnode creation with direct attribute initialization |
|
meerk40t/core/elements/branches.py |
Added group tracking and property reload signaling |
|
meerk40t/core/elements/branches.py |
Resolves issues #2692
Summary by Sourcery
Fix the delayed update of tree item labels when breaking subpaths by emitting the appropriate signal and refactor node attribute handling for clarity.
Bug Fixes:
Enhancements: