153be98780
Легенда и цифры на материале масштабируются от экрана игроков и не обрезаются жёлтой рамкой. Переключение сцен без записи project.json на диск. Co-authored-by: Cursor <cursoragent@cursor.com>
21 lines
1017 B
TypeScript
21 lines
1017 B
TypeScript
import React, { createContext, useContext } from 'react';
|
|
|
|
import type { SceneOverlayViewport } from './overlayViewport';
|
|
|
|
export type SceneOverlayViewContextValue = {
|
|
/** Внешний контейнер оверлея (полная область превью / презентации). */
|
|
rootRef: React.RefObject<HTMLDivElement | null>;
|
|
/** Слой маркеров легенды на материале (вне clipped viewport). */
|
|
markerLayerRef: React.RefObject<HTMLDivElement | null>;
|
|
/** Размеры области раскладки материалов (viewport.w/h). */
|
|
view: { w: number; h: number };
|
|
/** Смещение и размер viewport внутри rootRef (contentRect на презентации). */
|
|
viewport: SceneOverlayViewport | null;
|
|
};
|
|
|
|
export const SceneOverlayViewContext = createContext<SceneOverlayViewContextValue | null>(null);
|
|
|
|
export function useSceneOverlayView(): SceneOverlayViewContextValue | null {
|
|
return useContext(SceneOverlayViewContext);
|
|
}
|