forked from profectus/Profectus
Fix nodes appearing in center when selected
This commit is contained in:
parent
b6317a47e8
commit
80c66135b2
1 changed files with 2 additions and 5 deletions
|
@ -3,7 +3,7 @@
|
||||||
class="boardnode"
|
class="boardnode"
|
||||||
:class="{ [node.type]: true, isSelected, isDraggable }"
|
:class="{ [node.type]: true, isSelected, isDraggable }"
|
||||||
:style="{ opacity: dragging?.id === node.id && hasDragged ? 0.5 : 1 }"
|
: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
|
<BoardNodeAction
|
||||||
:actions="actions ?? []"
|
:actions="actions ?? []"
|
||||||
|
@ -244,6 +244,7 @@ function mouseDown(e: MouseEvent | TouchEvent) {
|
||||||
|
|
||||||
function mouseUp(e: MouseEvent | TouchEvent) {
|
function mouseUp(e: MouseEvent | TouchEvent) {
|
||||||
if (!props.hasDragged?.value) {
|
if (!props.hasDragged?.value) {
|
||||||
|
emit("endDragging", props.node.value.id);
|
||||||
props.nodeType.value.onClick?.(props.node.value);
|
props.nodeType.value.onClick?.(props.node.value);
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
}
|
}
|
||||||
|
@ -260,10 +261,6 @@ function mouseUp(e: MouseEvent | TouchEvent) {
|
||||||
fill: var(--highlighted);
|
fill: var(--highlighted);
|
||||||
}
|
}
|
||||||
|
|
||||||
.boardnode.isSelected {
|
|
||||||
transform: scale(1.2);
|
|
||||||
}
|
|
||||||
|
|
||||||
.boardnode.isSelected .body {
|
.boardnode.isSelected .body {
|
||||||
fill: var(--accent1) !important;
|
fill: var(--accent1) !important;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue