src/views/Plan2D.tsximport { useEffect, useMemo, useRef, useState } from 'react';import { useSceneStore } from '../scene/store';import { polygonCentroid, wallLength, wallNormal, wallOpeningRects, wallUnit } from '../scene/geometry';import {describeById,describeFixture,describeOpening,describeRoom,describeWall,SELECTED_COLOR,type Selected2D,} from '../scene/describe';import { Compass } from './Compass';import { ZoomControls } from '../ui/ZoomControls';import type { UnitSystem } from '../scene/units';import type { Opening, Scene, Vec2, Wall } from '../scene/schema';const PAD = 36; // inches of padding around scene boundsfunction sceneBounds(scene: Scene): { minX: number; minY: number; maxX: number; maxY: number } {
Showing the first 20 lines.
Get full code