]>
git.r.bdr.sh - rbdr/canvas/blob - src/lib/stores/canvas.js
2a5e89c36e118b5929e93abb84156fb4a1db0b70
1 import { browser
} from '$app/environment';
2 import { derived
, writable
} from 'svelte/store';
4 export const canvas
= writable({x: 0, y: 0});
6 export const topLeft
= derived(canvas
, ($canvas
) => {
9 x: $canvas
.x
- window
.screen
.width
/2,
10 y: $canvas
.y
- window
.screen
.height
/2
16 export const bottomRight
= derived(canvas
, ($canvas
) => {
19 x: $canvas
.x
+ window
.screen
.width
/2,
20 y: $canvas
.y
+ window
.screen
.height
/2