From af29f8babbb53185cc01a2a82f281ce67089c327 Mon Sep 17 00:00:00 2001 From: Philip Puk Date: Sat, 26 Mar 2022 14:23:12 +0000 Subject: [PATCH] fix with equi dist --- src/Renderer/DrawBlock/BusWire.fs | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/src/Renderer/DrawBlock/BusWire.fs b/src/Renderer/DrawBlock/BusWire.fs index d7d3c8e..a8fdac2 100644 --- a/src/Renderer/DrawBlock/BusWire.fs +++ b/src/Renderer/DrawBlock/BusWire.fs @@ -440,28 +440,26 @@ let initialWireVerticesFromPorts ], true // Left-to-right //fix issue by wrapping wire input port and not through for 1st quadrant - else if (abs(endX - startX) < 3.0*Wire.stickLength) - && (endY - startY < 3.0 * Wire.stickLength) then - [ + else if (((startX + endX) / 2.0)>(startX+Wire.stickLength)) then + [ {X = startX; Y = startY}; {X = startX + Wire.stickLength; Y = startY}; - {X = endX + Wire.stickLength*4.5; Y = startY}; - {X = endX + Wire.stickLength*4.5; Y = endY - Wire.stickLength}; - {X = endX; Y = endY - Wire.stickLength}; - {X = endX; Y = endY - Wire.stickLength}; - {X = endX; Y = endY - Wire.stickLength}; + {X = startX + Wire.stickLength; Y = startY}; + {X = (startX + endX) / 2.0; Y = startY}; + {X = (startX + endX) / 2.0; Y = endY-Wire.stickLength}; + {X = endX; Y = endY-Wire.stickLength}; + {X = endX; Y = endY-Wire.stickLength}; {X = endX; Y = endY} - ], - false // not Left-to-right + ], false else [ {X = startX; Y = startY}; {X = startX + Wire.stickLength; Y = startY}; {X = startX + Wire.stickLength; Y = startY}; + {X = startX + Wire.stickLength; Y = startY}; {X = startX + Wire.stickLength; Y = endY - Wire.stickLength}; {X = endX; Y = endY - Wire.stickLength}; {X = endX; Y = endY - Wire.stickLength}; - {X = endX; Y = endY - Wire.stickLength}; {X = endX; Y = endY} ], false @@ -576,7 +574,7 @@ let convertVerticesToASegs connId (isLeftToRight: bool) routetype rotation (yref | true -> [Horizontal;Horizontal;Horizontal;Horizontal;Vertical;Vertical;Vertical] | false -> - [Horizontal;Horizontal;Vertical;Horizontal;Vertical;Horizontal;Vertical] + [Horizontal;Vertical;Horizontal;Vertical;Horizontal;Vertical;Vertical] let draggable index = match routetype with