I found a really weird sliding connector bug.


If the connectors B and C are very very close to vertical but not quite exactly vertical, a math problem causes the mechanism to fail at a seemingly random position. In this case, I saw it fail about 3/4 of the way through a single cycle.

The fix was to use a different bit of math to determine if the intersection of a circle is before or after a line segment. The math to move this uses a circle-line intersection equation to figure out the location of X based on the location of W. I can’t explain the problem because I didn’t recognize the math I was using. What I decided to use is much simpler and easier to understand so I should avoid this sort of problem in the future.

How did this happen? When dragging link B into position, it seems to snap to the horizontal position of J or K as they are being moved. Normally, dragging a connector doesn’t move other connectors in varying amounts. Since these are sliders, they too move as B moves. The fix is to ignore the sliding connectors for the purpose of snapping; That’s going to be interesting/tricky to figure out since there could be a lot more than one or two sliders all moving as a limit connectors is being moved. I think I know what to do though; I’ll just check the slide limits of connectors when testing for snap and never use any connector whose limit is being moved. We’ll see how that goes and if there’s ever a reason it should not happen that way.

A new beta version is here: https://www.rectorsquid.com/beta/linkage.msi

I’m thinking of getting rid of the 32 bit version of the software. I know that Apple will no longer support 32 bit programs for Mac, either now or in the near future. It seems like it’s about time I do the same with the Linkage program.