Commit 58b69cd4 authored by Michael Büsch's avatar Michael Büsch

fup_wire: Don't draw branches for directly drawn wires

Signed-off-by: Michael Büsch's avatarMichael Buesch <m@bues.ch>
parent 4dc99393
......@@ -131,12 +131,11 @@ class FupWire(FupBaseClass):
self.grid.removeWire(self)
class DrawInfo(object):
__slots__ = ("segments", # Regular segments (list)
"segDirect") # Direct connection segment
usesDirect = False
def __init__(self, segments, segDirect):
self.segments = segments
self.segDirect = segDirect
self.segments = segments # Regular segments (list)
self.segDirect = segDirect # Direct connection segment
@property
def allRegularSegments(self):
......@@ -196,10 +195,13 @@ class FupWire(FupBaseClass):
else:
drawSeg(drawInfo.segDirect,
pen=self.__wireCollidingPen)
drawInfo.usesDirect = True
# Draw the branch circles
startIntersections = self.StartIntersections()
for drawInfo in wireLines:
if drawInfo.usesDirect:
continue
for seg in drawInfo.allRegularSegments:
intersections = {}
def addInter(interPoint, otherSeg):
......@@ -216,7 +218,8 @@ class FupWire(FupBaseClass):
intersections[key] = intersections.setdefault(key, 0) + 1
for otherDrawInfo in wireLines:
if drawInfo is otherDrawInfo:
if otherDrawInfo is drawInfo or\
otherDrawInfo.usesDirect:
continue
for otherSeg in otherDrawInfo.allRegularSegments:
inter = seg.intersection(otherSeg)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment