File tree Expand file tree Collapse file tree 3 files changed +9
-11
lines changed
src/canvas-extensions/advanced-styles Expand file tree Collapse file tree 3 files changed +9
-11
lines changed Original file line number Diff line number Diff line change 11{
22 "id" : " advanced-canvas" ,
33 "name" : " Advanced Canvas" ,
4- "version" : " 3.0.5 " ,
4+ "version" : " 3.0.6 " ,
55 "minAppVersion" : " 1.1.0" ,
66 "description" : " Supercharge your canvas experience! Create presentations, flowcharts and more!" ,
77 "author" : " Developer-Mike" ,
Original file line number Diff line number Diff line change @@ -85,13 +85,12 @@ export default class EdgeStylesExtension extends CanvasExtension {
8585 for ( const edge of selectedEdges ) {
8686 const edgeData = edge . getData ( )
8787
88- const newStyleAttributes = { ...edgeData . styleAttributes }
89- if ( value !== null ) newStyleAttributes [ attribute . datasetKey ] = value
90- else delete newStyleAttributes [ attribute . datasetKey ]
91-
9288 edge . setData ( {
9389 ...edgeData ,
94- styleAttributes : newStyleAttributes
90+ styleAttributes : {
91+ ...edgeData . styleAttributes ,
92+ [ attribute . datasetKey ] : value
93+ }
9594 } )
9695 }
9796
Original file line number Diff line number Diff line change @@ -47,13 +47,12 @@ export default class NodeStylesExtension extends CanvasExtension {
4747 // Only apply the attribute if the node type is allowed
4848 if ( attribute . nodeTypes && ! attribute . nodeTypes . includes ( nodeData . type ) ) continue
4949
50- const newStyleAttributes = { ...nodeData . styleAttributes }
51- if ( value !== null ) newStyleAttributes [ attribute . datasetKey ] = value
52- else delete newStyleAttributes [ attribute . datasetKey ]
53-
5450 node . setData ( {
5551 ...nodeData ,
56- styleAttributes : newStyleAttributes
52+ styleAttributes : {
53+ ...nodeData . styleAttributes ,
54+ [ attribute . datasetKey ] : value
55+ }
5756 } )
5857 }
5958
You can’t perform that action at this time.
0 commit comments