Fix sanitizeShapes.
This commit is contained in:
parent
9d22c55aba
commit
802c3cd028
1 changed files with 4 additions and 1 deletions
|
|
@ -240,9 +240,12 @@ scheduleSnappedGridSize();
|
||||||
function isFiniteNum(n) { return Number.isFinite(Number(n)); }
|
function isFiniteNum(n) { return Number.isFinite(Number(n)); }
|
||||||
|
|
||||||
function sanitizeShapes(list) {
|
function sanitizeShapes(list) {
|
||||||
|
const allowed = ['rect', 'ellipse', 'line'];
|
||||||
|
|
||||||
return list.filter(s => {
|
return list.filter(s => {
|
||||||
if (!s || typeof s !== 'object') return false;
|
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.color) s.color = '#000000';
|
||||||
|
|
||||||
if (s.type === 'line') {
|
if (s.type === 'line') {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue