mirror of
https://github.com/jackyzha0/quartz.git
synced 2026-03-24 15:05:42 -05:00
fix(graph): update persistent for nodeGfx
Signed-off-by: Aaron Pham <contact@aarnphm.xyz>
This commit is contained in:
parent
e00c1ac491
commit
d7b986f3f5
@ -362,6 +362,7 @@ async function renderGraph(container: string, fullSlug: FullSlug) {
|
|||||||
})
|
})
|
||||||
.circle(0, 0, nodeRadius(n))
|
.circle(0, 0, nodeRadius(n))
|
||||||
.on("pointerover", () => {
|
.on("pointerover", () => {
|
||||||
|
if (!currentNodeGfx) {
|
||||||
tweens.get(nodeId)?.stop()
|
tweens.get(nodeId)?.stop()
|
||||||
const tweenScale = { x: 1, y: 1 }
|
const tweenScale = { x: 1, y: 1 }
|
||||||
const tween = new TWEEN.Tween(tweenScale)
|
const tween = new TWEEN.Tween(tweenScale)
|
||||||
@ -375,6 +376,7 @@ async function renderGraph(container: string, fullSlug: FullSlug) {
|
|||||||
.start()
|
.start()
|
||||||
tweens.set(nodeId, tween)
|
tweens.set(nodeId, tween)
|
||||||
renderCurrentNode({ nodeId, focusOnHover })
|
renderCurrentNode({ nodeId, focusOnHover })
|
||||||
|
}
|
||||||
})
|
})
|
||||||
.on("pointerdown", (e) => {
|
.on("pointerdown", (e) => {
|
||||||
currentNodeGfx = e.target as PIXI.Graphics
|
currentNodeGfx = e.target as PIXI.Graphics
|
||||||
@ -386,6 +388,7 @@ async function renderGraph(container: string, fullSlug: FullSlug) {
|
|||||||
currentNodeGfx = undefined
|
currentNodeGfx = undefined
|
||||||
})
|
})
|
||||||
.on("pointerleave", () => {
|
.on("pointerleave", () => {
|
||||||
|
if (!currentNodeGfx) {
|
||||||
tweens.get(nodeId)?.stop()
|
tweens.get(nodeId)?.stop()
|
||||||
const tweenScale = {
|
const tweenScale = {
|
||||||
x: gfx.scale.x,
|
x: gfx.scale.x,
|
||||||
@ -402,6 +405,7 @@ async function renderGraph(container: string, fullSlug: FullSlug) {
|
|||||||
.start()
|
.start()
|
||||||
tweens.set(nodeId, tween)
|
tweens.set(nodeId, tween)
|
||||||
renderCurrentNode({ nodeId: null, focusOnHover })
|
renderCurrentNode({ nodeId: null, focusOnHover })
|
||||||
|
}
|
||||||
})
|
})
|
||||||
n.gfx = gfx
|
n.gfx = gfx
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user