Изменение размещения тултипа датчика, изменение страницы объекта (убрана кнопка изменить, добавлена граница карточки объекта для лучшего вида на темном фоне, добавлен отступ и изменено положение заголовка

This commit is contained in:
2026-02-10 00:26:53 +03:00
parent e50e525ad4
commit c6bc5d19f2
5 changed files with 1172 additions and 25 deletions

View File

@@ -827,7 +827,7 @@ const ModelViewer: React.FC<ModelViewerProps> = ({
}, [modelReady, isSensorSelectionEnabled, onSensorPick])
const computeOverlayPosition = React.useCallback((mesh: AbstractMesh | null) => {
if (!sceneRef.current || !mesh) return null
if (!sceneRef.current || !mesh || !canvasRef.current) return null
const scene = sceneRef.current
try {
const bbox = (typeof mesh.getHierarchyBoundingVectors === 'function')
@@ -841,7 +841,13 @@ const ModelViewer: React.FC<ModelViewerProps> = ({
const projected = Vector3.Project(center, Matrix.Identity(), scene.getTransformMatrix(), viewport)
if (!projected) return null
return { left: projected.x, top: projected.y }
// Позиционируем тултип слева от датчика
// Учитываем ширину тултипа (max-w-[400px]) + отступ 50px от датчика
const tooltipWidth = 400 // Максимальная ширина тултипа из DetectorMenu
const gapFromSensor = 50 // Отступ между правым краем тултипа и датчиком
const leftOffset = -(tooltipWidth + gapFromSensor) // Смещение влево от датчика
return { left: projected.x + leftOffset, top: projected.y }
} catch (error) {
console.error('[ModelViewer] Error computing overlay position:', error)
return null