Fix sanitizeShapes.

This commit is contained in:
Yaro Kasear 2025-12-16 10:54:39 -06:00
parent 9d22c55aba
commit 802c3cd028

View file

@ -240,9 +240,12 @@ scheduleSnappedGridSize();
function isFiniteNum(n) { return Number.isFinite(Number(n)); }
function sanitizeShapes(list) {
const allowed = ['rect', 'ellipse', 'line'];
return list.filter(s => {
if (!s || typeof s !== 'object') return false;
if (!['rect','ellipse','line'].include(s.type)) return false;
if (!allowed.includes(s.type)) return false;
if (!s.color) s.color = '#000000';
if (s.type === 'line') {