I can not understand why there is a differential displacement Result . Polygons and text shifted uniformly, line relative error polygons shifted.
function setNewPosition(x, y) {
var lines = stage.find('Line');
if (lines.length > 0) {
lines.forEach(function inLines(line) {
var points = line.getPoints();
if (points.length > 0) {
points.forEach(function pSet(p) {
p.x += x;
p.y += y;
});
}
});
};
polygons = stage.find('Polygon');
if (polygons.length > 0) {
polygons.forEach(function inPoly(polygon) {
var points = polygon.getPoints();
if (points.length > 0) {
points.forEach(function pSet(p) {
p.x += x;
p.y += y;
});
}
});
};
texts = stage.find('Text');
if (texts.length > 0)
texts.forEach(function inText(text) {
oX = text.getX();
oY = text.getY();
text.setX(oX + x);
text.setY(oY + y);
}
);
layer.draw();
}