feat(core): use zIndex or style for node elevation

Signed-off-by: braks <78412429+bcakmakoglu@users.noreply.github.com>
This commit is contained in:
braks
2023-01-09 10:30:18 +01:00
committed by Braks
parent 148276dda6
commit 8c84d5cea4

View File

@@ -120,11 +120,13 @@ watch(
() => parentNode?.dimensions.width,
],
([newX, newY, parentX, parentY, parentZ]) => {
let zIndex = isNumber(node.zIndex) ? node.zIndex : 0
zIndex = isNumber(getStyle.value.zIndex) ? getStyle.value.zIndex : zIndex
const xyzPos = {
x: newX,
y: newY,
// if a zIndex style is present, add 1000 to it
z: (isNumber(getStyle.value.zIndex) ? getStyle.value.zIndex : 0) + (elevateNodesOnSelect ? (node.selected ? 1000 : 0) : 0),
z: zIndex + (elevateNodesOnSelect ? (node.selected ? 1000 : 0) : 0),
}
if (parentX && parentY) {