refactor(ui): better hud

This commit is contained in:
psychedelicious 2024-06-16 20:23:42 +10:00
parent 7ec059f5fa
commit d8539daf1f

View File

@ -12,19 +12,19 @@ export const HeadsUpDisplay = memo(() => {
return (
<Flex flexDir="column" bg="blackAlpha.400" borderBottomEndRadius="base" p={2} minW={64} gap={2}>
<HUDItem label="Scale" value={round(stageAttrs.scale, 3)} />
<HUDItem label="Zoom" value={`${round(stageAttrs.scale * 100, 2)}%`} />
<HUDItem label="Document Size" value={`${document.width}×${document.height}`} />
<HUDItem label="Stage Pos" value={`${round(stageAttrs.x, 3)}, ${round(stageAttrs.y, 3)}`} />
<HUDItem
label="Stage Size"
value={`${round(stageAttrs.width / stageAttrs.scale, 3)}, ${round(stageAttrs.height / stageAttrs.scale, 3)}`}
value={`${round(stageAttrs.width / stageAttrs.scale, 2)}, ${round(stageAttrs.height / stageAttrs.scale, 2)}`}
/>
<HUDItem label="BBox Size" value={`${bbox.width}×${bbox.height}`} />
<HUDItem label="BBox Position" value={`${bbox.x}, ${bbox.y}`} />
<HUDItem label="BBox Width % 8" value={round(bbox.width % 8, 3)} />
<HUDItem label="BBox Height % 8" value={round(bbox.height % 8, 3)} />
<HUDItem label="BBox X % 8" value={round(bbox.x % 8, 3)} />
<HUDItem label="BBox Y % 8" value={round(bbox.y % 8, 3)} />
<HUDItem label="BBox Width % 8" value={round(bbox.width % 8, 2)} />
<HUDItem label="BBox Height % 8" value={round(bbox.height % 8, 2)} />
<HUDItem label="BBox X % 8" value={round(bbox.x % 8, 2)} />
<HUDItem label="BBox Y % 8" value={round(bbox.y % 8, 2)} />
</Flex>
);
});