am i right in assuming that this only works if the line starts inside the path?
i’m making a concept mapping program (the one i like most is pretty buggy and slow), and so i have blocks that are joined by arrows.
say i have two rectangular components. the centres are joined with a line, but i wish for the line to actually start at the edges rather than the centre (but point to the centres). the easiest way i found to do this is…
[saying A is the start block and B is the end block]
- create a line from centreA to centreB
- create a path with the rectangular bounds of A
- clip the line to the path
- clear the path, and add the rectangular bounds of B
- clip the line to the path
the second clipping doesn’t do anything, and i imagine it’s because the line doesn’t start within the path. i tried them the other way round and it always leaves the end of the line unaltered.
is there an easier way to do this? the first thing i was going to do was use the withShortenedEnd/Start functions, but that appears to involve trig functions plus lots of conditionals (determining the amount to reduce by probably depends on which side the other box is on).