refactor: rename internal data field to __vf

Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
This commit is contained in:
Braks
2021-11-21 12:54:04 +01:00
parent 71ba905348
commit 0e9f8c5fc2
12 changed files with 62 additions and 62 deletions
+4 -4
View File
@@ -13,7 +13,7 @@ export default () =>
Object.assign(node, {
id: node.id.toString(),
type: node.type || 'default',
__rf: {
__vf: {
position: clampPosition(node.position, nodeExtent),
width: undefined,
height: undefined,
@@ -49,16 +49,16 @@ export default () =>
if (storeNode) {
const updatedNode: Node = Object.assign(storeNode, element)
if (!updatedNode.__rf) updatedNode.__rf = {}
if (!updatedNode.__vf) updatedNode.__vf = {}
if (storeNode.position.x !== element.position.x || storeNode.position.y !== element.position.y) {
updatedNode.__rf.position = element.position
updatedNode.__vf.position = element.position
}
if (typeof element.type !== 'undefined' && element.type !== storeNode.type) {
// we reset the elements dimensions here in order to force a re-calculation of the bounds.
// When the type of a node changes it is possible that the number or positions of handles changes too.
updatedNode.__rf.width = undefined
updatedNode.__vf.width = undefined
}
nextElements.nextNodes.push(updatedNode)