auto-save 2026-05-13 15:33 (~4)
This commit is contained in:
@@ -479,19 +479,25 @@ export function KeyframeNode({ data, selected }: any) {
|
||||
)}
|
||||
</NodeShell>
|
||||
|
||||
{/* Portal hover 预览 — 固定视口右下角,不遮挡 */}
|
||||
{/* Portal hover 预览 — 缩略图正上方展开(DAG 画布上方空旷) */}
|
||||
{mounted && hover && jobId && (() => {
|
||||
const hf = frames.find((x) => x.index === hover.idx)
|
||||
if (!hf) return null
|
||||
const vidAspect = d.job && d.job.height > 0 ? d.job.height / d.job.width : 16 / 9
|
||||
const w = 280
|
||||
const h = w * vidAspect
|
||||
const gap = 12
|
||||
// 高度优先:不超过缩略图上方可用空间,也不超过视口 80vh
|
||||
const maxH = Math.max(160, Math.min(window.innerHeight * 0.8, hover.rect.top - gap - 12))
|
||||
const maxW = Math.min(window.innerWidth * 0.45, 480)
|
||||
let h = maxH, w = h / vidAspect
|
||||
if (w > maxW) { w = maxW; h = w * vidAspect }
|
||||
const centerX = hover.rect.left + hover.rect.width / 2
|
||||
const left = Math.max(12, Math.min(window.innerWidth - w - 12, centerX - w / 2))
|
||||
const top = hover.rect.top - h - gap
|
||||
return createPortal(
|
||||
<div
|
||||
className="fixed z-[120] pointer-events-none"
|
||||
style={{
|
||||
right: 20,
|
||||
bottom: 20,
|
||||
left, top,
|
||||
animation: "drawer-in 0.18s cubic-bezier(0.32, 0.72, 0, 1)",
|
||||
}}
|
||||
>
|
||||
@@ -717,21 +723,26 @@ export function ImageGenNode({ data, selected }: any) {
|
||||
)}
|
||||
</NodeShell>
|
||||
|
||||
{/* Portal hover 预览 — 固定视口右下角,不遮挡 */}
|
||||
{/* Portal hover 预览 — 缩略图正上方展开 */}
|
||||
{mounted && hover && job && (() => {
|
||||
const [fi, ei] = hover.key.split("_")
|
||||
const frameIdx = parseInt(fi, 10)
|
||||
const p = elementCrops.find((x) => x.frameIdx === frameIdx && x.elementId === ei)
|
||||
if (!p) return null
|
||||
const vidAspect = job.height > 0 ? job.height / job.width : 16 / 9
|
||||
const w = 280
|
||||
const h = w * vidAspect
|
||||
const gap = 12
|
||||
const maxH = Math.max(160, Math.min(window.innerHeight * 0.8, hover.rect.top - gap - 12))
|
||||
const maxW = Math.min(window.innerWidth * 0.45, 480)
|
||||
let h = maxH, w = h / vidAspect
|
||||
if (w > maxW) { w = maxW; h = w * vidAspect }
|
||||
const centerX = hover.rect.left + hover.rect.width / 2
|
||||
const left = Math.max(12, Math.min(window.innerWidth - w - 12, centerX - w / 2))
|
||||
const top = hover.rect.top - h - gap
|
||||
return createPortal(
|
||||
<div
|
||||
className="fixed z-[120] pointer-events-none"
|
||||
style={{
|
||||
right: 20,
|
||||
bottom: 20,
|
||||
left, top,
|
||||
animation: "drawer-in 0.18s cubic-bezier(0.32, 0.72, 0, 1)",
|
||||
}}
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user