This commit is contained in:
Linrador 2026-06-29 23:01:24 +02:00
parent 8b5e0b6101
commit 95bf0fdd79
4 changed files with 20 additions and 0 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -11419,6 +11419,12 @@ export default function TrainingTab(props: {
const boxWidth = hasUsableBox ? activeBox.w * imageWidth : 0 const boxWidth = hasUsableBox ? activeBox.w * imageWidth : 0
const boxHeight = hasUsableBox ? activeBox.h * imageHeight : 0 const boxHeight = hasUsableBox ? activeBox.h * imageHeight : 0
const showPoseMagnifierSkeleton = poseSkeletonVisible && Boolean(poseMagnifierInteraction) const showPoseMagnifierSkeleton = poseSkeletonVisible && Boolean(poseMagnifierInteraction)
const magnifierIsAbovePointer = top + size / 2 <= touchMagnifier.clientY
const activeMagnifierLabel = hasUsablePoseMagnifierPoint
? poseKeypointLabel(activePoseMagnifierPoint?.name)
: hasUsableBox
? getSegmentLabelItem(activeBox.label).text || activeBox.label
: ''
return typeof document !== 'undefined' return typeof document !== 'undefined'
? createPortal( ? createPortal(
@ -11581,6 +11587,20 @@ export default function TrainingTab(props: {
top: pointerY, top: pointerY,
}} }}
/> />
{activeMagnifierLabel ? (
<div
className={[
'absolute left-1/2 z-20 max-w-[calc(100%-1rem)] -translate-x-1/2 truncate rounded-full',
'bg-black/75 px-2.5 py-1 text-[10px] font-black leading-none text-white',
'shadow-lg ring-1 ring-white/20 backdrop-blur',
magnifierIsAbovePointer ? 'top-2' : 'bottom-2',
].join(' ')}
title={activeMagnifierLabel}
>
{activeMagnifierLabel}
</div>
) : null}
</div>, </div>,
document.body document.body
) )