my problem is quite simple. I have two points and I want to draw a line in between them. The line has to be divided into two parts of the same size. Sadly the ends don't connect to each other at the middle between the two points. A one pixel gap is left.
This gap results form the antialiasing. The half opaque borders of the two elements "add up" to a white gap.
Through the svg attribute "shape-rendering="crispEdges"" I am able to turn off the antialiasing which removes the gap between the elements but then the lines are just "ugly" as can be seen here: http://jsfiddle.net/GsczH/
<polyline id="line2-part2" stroke="#225788" stroke-width="16" fill="none" points="678.5,124.5 498.5,137.5"/>
<polyline id="line2-part1" stroke="#0064FF" stroke-width="16" fill="none" points="318.5,150.5 498.5,137.5"/>
These are the line objects the way they are currently implemented. They work perfectly except the gap in between them.
Solutions I tried so far:
-rounding the middlepoint so that the lines overlap, but firstly then the lines aren't perfectly straight anymore and even if I could fix that, the antialisng now adds up the colors which results in a "bump" on the overlapping pixels. (try it with the horizontal line if you want to see what I mean)
-replacing the lines with polygons, which could work, but I couldn't get the corner point calculation precise enough
The simplest/best solution I can come up with at the moment is to get the lineobjects to stop "adding up" to white. In simpler terms, at the moment it is grey+grey=white but I want grey+grey=black. But I don't know if I can get them to do that or not to do so.
Hopefully you can help me to come up with something. Thanks in Advance!