Yuya Nishihara committed 95038a3 Draft

graph: remove fully-overlapped lines prior to painting

Because antialiasing is enabled, overlapped lines can be alpha-blended and
be slightly bolder than single line.

This can solve most of the problem, but still, lines can partially overlap
near contact points:

| |
| <-- 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)
+            # even after overlapped lines are removed, it's still necessary to
+            # sort by importance.  lines can partially overlap near contact.
+            lines = sorted(dict(sorted(lines, key=lineimportance)).iteritems(),
+                           key=lineimportance)
             for (start, end), e in lines:
                 active = isactive(e)