Yuya Nishihara committed 26ea615

graph: remove fully-overlapped lines prior to painting

Since 56d26e4d7f55, overlapped lines can be alpha-blended and be slightly
bolder than single line because of antialiasing.

This solves most of the problem, but still, lines can be slightly bolder
near contact point:

| |
| <-- upper half will be doubled even if overlapped edges are removed

Comments (0)

Files changed (1)


             ymid = (y1 + y4)/2
             y3 = y1 + 3 * (y4 - y1)/4
-            lines = sorted(lines, key=lineimportance)
+            # remove hidden lines that can be partly visible due to antialiasing
+            lines = dict(sorted(lines, key=lineimportance)).items()
+            # still necessary to sort by importance because lines can partially
+            # overlap near contact point
+            lines.sort(key=lineimportance)
             for (start, end), e in lines:
                 active = isactive(e)