Skip to content

Commit

Permalink
fix: added migration for elements v4
Browse files Browse the repository at this point in the history
  • Loading branch information
jmjuanes committed May 5, 2023
1 parent 39f4797 commit 4b03607
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion folio-core/constants.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export const VERSION = "3";
export const VERSION = "4";

export const PI = Math.PI;
export const EPSILON = 1e-6;
Expand Down
11 changes: 9 additions & 2 deletions folio-core/migrate.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
});
Expand Down

0 comments on commit 4b03607

Please sign in to comment.