Fix nodes appearing in center when selected

This commit is contained in:
thepaperpilot 2023-04-22 00:33:20 -05:00
parent e44a43aad5
commit 2f97dbc58d

View file

@ -3,7 +3,7 @@
class="boardnode"
:class="{ [node.type]: true, isSelected, isDraggable }"
:style="{ opacity: dragging?.id === node.id && hasDragged ? 0.5 : 1 }"
:transform="`translate(${position.x},${position.y})`"
:transform="`translate(${position.x},${position.y})${isSelected ? ' scale(1.2)' : ''}`"
>
<BoardNodeAction
:actions="actions ?? []"
@ -248,6 +248,7 @@ function mouseDown(e: MouseEvent | TouchEvent) {
function mouseUp(e: MouseEvent | TouchEvent) {
if (!props.hasDragged?.value) {
emit("endDragging", props.node.value.id);
props.nodeType.value.onClick?.(props.node.value);
e.stopPropagation();
}
@ -264,10 +265,6 @@ function mouseUp(e: MouseEvent | TouchEvent) {
fill: var(--highlighted);
}
.boardnode.isSelected {
transform: scale(1.2);
}
.boardnode.isSelected .body {
fill: var(--accent1) !important;
}