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,19 +362,21 @@ async function renderGraph(container: string, fullSlug: FullSlug) {
|
||||
})
|
||||
.circle(0, 0, nodeRadius(n))
|
||||
.on("pointerover", () => {
|
||||
tweens.get(nodeId)?.stop()
|
||||
const tweenScale = { x: 1, y: 1 }
|
||||
const tween = new TWEEN.Tween(tweenScale)
|
||||
.to({ x: 1.5, y: 1.5 }, 100)
|
||||
.onUpdate(() => {
|
||||
gfx.scale.set(tweenScale.x, tweenScale.y)
|
||||
})
|
||||
.onStop(() => {
|
||||
tweens.delete(nodeId)
|
||||
})
|
||||
.start()
|
||||
tweens.set(nodeId, tween)
|
||||
renderCurrentNode({ nodeId, focusOnHover })
|
||||
if (!currentNodeGfx) {
|
||||
tweens.get(nodeId)?.stop()
|
||||
const tweenScale = { x: 1, y: 1 }
|
||||
const tween = new TWEEN.Tween(tweenScale)
|
||||
.to({ x: 1.5, y: 1.5 }, 100)
|
||||
.onUpdate(() => {
|
||||
gfx.scale.set(tweenScale.x, tweenScale.y)
|
||||
})
|
||||
.onStop(() => {
|
||||
tweens.delete(nodeId)
|
||||
})
|
||||
.start()
|
||||
tweens.set(nodeId, tween)
|
||||
renderCurrentNode({ nodeId, focusOnHover })
|
||||
}
|
||||
})
|
||||
.on("pointerdown", (e) => {
|
||||
currentNodeGfx = e.target as PIXI.Graphics
|
||||
@ -386,22 +388,24 @@ async function renderGraph(container: string, fullSlug: FullSlug) {
|
||||
currentNodeGfx = undefined
|
||||
})
|
||||
.on("pointerleave", () => {
|
||||
tweens.get(nodeId)?.stop()
|
||||
const tweenScale = {
|
||||
x: gfx.scale.x,
|
||||
y: gfx.scale.y,
|
||||
if (!currentNodeGfx) {
|
||||
tweens.get(nodeId)?.stop()
|
||||
const tweenScale = {
|
||||
x: gfx.scale.x,
|
||||
y: gfx.scale.y,
|
||||
}
|
||||
const tween = new TWEEN.Tween(tweenScale)
|
||||
.to({ x: 1, y: 1 }, 100)
|
||||
.onUpdate(() => {
|
||||
gfx.scale.set(tweenScale.x, tweenScale.y)
|
||||
})
|
||||
.onStop(() => {
|
||||
tweens.delete(nodeId)
|
||||
})
|
||||
.start()
|
||||
tweens.set(nodeId, tween)
|
||||
renderCurrentNode({ nodeId: null, focusOnHover })
|
||||
}
|
||||
const tween = new TWEEN.Tween(tweenScale)
|
||||
.to({ x: 1, y: 1 }, 100)
|
||||
.onUpdate(() => {
|
||||
gfx.scale.set(tweenScale.x, tweenScale.y)
|
||||
})
|
||||
.onStop(() => {
|
||||
tweens.delete(nodeId)
|
||||
})
|
||||
.start()
|
||||
tweens.set(nodeId, tween)
|
||||
renderCurrentNode({ nodeId: null, focusOnHover })
|
||||
})
|
||||
n.gfx = gfx
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user