From 4b03607257fd76d4c0d9e29c8b1dcc222ce7350d Mon Sep 17 00:00:00 2001 From: Josemi Date: Sat, 6 May 2023 00:19:31 +0200 Subject: [PATCH] fix: added migration for elements v4 --- folio-core/constants.js | 2 +- folio-core/migrate.js | 11 +++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/folio-core/constants.js b/folio-core/constants.js index 4bf47845..e3abcda0 100644 --- a/folio-core/constants.js +++ b/folio-core/constants.js @@ -1,4 +1,4 @@ -export const VERSION = "3"; +export const VERSION = "4"; export const PI = Math.PI; export const EPSILON = 1e-6; diff --git a/folio-core/migrate.js b/folio-core/migrate.js index 65f3445c..f578b67e 100644 --- a/folio-core/migrate.js +++ b/folio-core/migrate.js @@ -12,11 +12,18 @@ export const migrateElements = (data, version) => { delete element.minHeight; } else if (element.type === ELEMENTS.DRAW) { - element.edgeHandlers = true; - element.cornerHandlers = true; + // element.edgeHandlers = true; + // element.cornerHandlers = true; element.drawWidth = Math.abs(element.x2 - element.x1); element.drawHeight = Math.abs(element.y2 - element.y1); } + case "3": + // new field group + // edgeHandlers, cornerHandlers and nodeHandlers have been deprecated + element.group = element.group || null; + delete element.edgeHandlers; + delete element.cornerHandlers; + delete element.nodeHandlers; } return element; });