From 1fd58cc84757a370199776219b24a77f8c5d9bfc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Hru=C5=A1ka?= Date: Tue, 26 Sep 2017 16:03:29 +0200 Subject: [PATCH] Make negative scaleFactor reverse middle arrow correctly (#3474) --- lib/network/modules/components/edges/util/EdgeBase.js | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/network/modules/components/edges/util/EdgeBase.js b/lib/network/modules/components/edges/util/EdgeBase.js index d39fb8af..e703e7a5 100644 --- a/lib/network/modules/components/edges/util/EdgeBase.js +++ b/lib/network/modules/components/edges/util/EdgeBase.js @@ -538,6 +538,7 @@ class EdgeBase { } } + if (position === 'middle' && scaleFactor < 0) lineWidth *= -1; // reversed middle arrow let length = 15 * scaleFactor + 3 * lineWidth; // 3* lineWidth is the width of the edge. var xi = arrowPoint.x - length * 0.9 * Math.cos(angle);