mirror of
https://github.com/openswarm-ai/openswarm.git
synced 2026-09-13 05:07:40 +02:00
[eric] canvas: the camera writer publishes --canvas-zoom for chrome that must not shrink with the map
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015xkMseod9vJ3hCrE43ctDo (cherry picked from commit f492d6af5c1bac1ec9e2c3966cf0907a80a4af86)
This commit is contained in:
@@ -125,7 +125,10 @@ export function useCanvasControls(
|
|||||||
const applyLiveToDom = useCallback(() => {
|
const applyLiveToDom = useCallback(() => {
|
||||||
const { panX, panY, zoom } = stateRef.current;
|
const { panX, panY, zoom } = stateRef.current;
|
||||||
const content = contentRef.current;
|
const content = contentRef.current;
|
||||||
if (content) content.style.transform = `translate(${panX}px, ${panY}px) scale(${zoom})`;
|
if (content) {
|
||||||
|
content.style.transform = `translate(${panX}px, ${panY}px) scale(${zoom})`;
|
||||||
|
content.style.setProperty('--canvas-zoom', String(zoom));
|
||||||
|
}
|
||||||
const grid = gridRef.current;
|
const grid = gridRef.current;
|
||||||
if (grid) {
|
if (grid) {
|
||||||
const spacing = 24 * zoom;
|
const spacing = 24 * zoom;
|
||||||
|
|||||||
Reference in New Issue
Block a user