I know we have discussed this is #24. But I feel that we should have default names for each shape created.
In #24 you had suggested that we should pass the name such as:
const rect = editor.shapes.rect.insert({
name: '<name>',
// rest config
})
and access that through console.log(rect.node.name()), or change the name through rect.node.name('<new name>')
I feel that this leaves room for bugs, due to missing this in Pikaso's documentation.
I suggest we add a method renameShape() and add
public insert(config: Konva.ArrowConfig): ArrowModel {
return super.insert({
name: `${type}`
...config
})
}
and duplicate take the name of the original, and postfix -copy, e.g, triangle to triangle-copy.
Two shapes can have the same name however...
I know we have discussed this is #24. But I feel that we should have default names for each shape created.
In #24 you had suggested that we should pass the name such as:
and access that through
console.log(rect.node.name()), or change the name throughrect.node.name('<new name>')I feel that this leaves room for bugs, due to missing this in Pikaso's documentation.
I suggest we add a method
renameShape()and addand duplicate take the name of the original, and postfix
-copy, e.g,triangletotriangle-copy.Two shapes can have the same name however...