2 import { browser } from '$app/environment';
3 import { maxSize } from '$lib/config';
4 import { modulo } from '$lib/math';
5 import { canvas } from '$lib/stores/canvas';
6 import { sensor } from '$lib/stores/widgets';
16 const fetchItems = function fetchItems(left, top, right, bottom) {
18 timer = setTimeout(() => {
19 sensor.set({ left, top, right, bottom });
25 left = modulo($canvas.x - window.screen.width * kSensorSize, maxSize);
26 top = modulo($canvas.y - window.screen.height * kSensorSize, maxSize);
27 right = left + 2 * window.screen.width * kSensorSize;
28 bottom = top + 2 * window.screen.height * kSensorSize;
30 fetchItems(left, top, right, bottom);