This commit is contained in:
Paulo Gustavo Veiga 2022-11-30 19:21:14 -08:00
parent 4dc64111c0
commit bcee2e21d4
2 changed files with 8 additions and 7 deletions

View File

@ -1,5 +1,4 @@
import xmlFormatter from 'xml-formatter';
import { off } from 'process';
import Importer from './Importer';
import Mindmap from '../model/Mindmap';
import RelationshipModel from '../model/RelationshipModel';

View File

@ -41,14 +41,16 @@ class Point {
}
Point.fromString = function pointFromString(point) {
const values = point.split(',');
let result = null;
if (values.lenght > 1) {
const x = Number.parseInt(values[0], 10);
const y = Number.parseInt(values[1], 10);
if (point) {
const values = point.split(',');
if (values.lenght > 1) {
const x = Number.parseInt(values[0], 10);
const y = Number.parseInt(values[1], 10);
if (!Number.isNaN(x) && !Number.isNaN(y)) {
result = new Point(x, y);
if (!Number.isNaN(x) && !Number.isNaN(y)) {
result = new Point(x, y);
}
}
}
return result;