of course there must be || to check positions if moving is too fast

This commit is contained in:
Daniel Lazar
2019-08-12 19:45:43 +02:00
parent cff54426c9
commit 4cae28c808

View File

@ -216,7 +216,7 @@ export class RightAngleLinkWidget extends React.Component<RightAngleLinkProps, R
for (let i = 1; i < points.length; i+= points.length - 2) {
let dx = Math.abs(points[i].getX() - points[i - 1].getX());
let dy = Math.abs(points[i].getY() - points[i - 1].getY());
if (dx !== 0 && dy !== 0) {
if (dx !== 0 || dy !== 0) {
if (dx < dy) {
if (i - 1 === 0) { points[i].setPosition(points[i - 1].getX(), points[i].getY()); }
else if (i === points.length - 1) { points[i - 1].setPosition(points[i].getX(), points[i - 1].getY());}