From dc8f8b5ff7e9df994611717cd7fcb3fd17070b60 Mon Sep 17 00:00:00 2001 From: Michael Schindler Date: Sun, 21 May 2006 18:27:14 +0000 Subject: [PATCH] allow empty paramlist in normath._split_pt -- and some consequence in connector git-svn-id: https://pyx.svn.sourceforge.net/svnroot/pyx/trunk/pyx@2751 069f4177-920e-0410-937b-c2a4a81bcd90 --- pyx/connector.py | 8 +++++--- pyx/normpath.py | 2 ++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/pyx/connector.py b/pyx/connector.py index e30c258e..cc341645 100644 --- a/pyx/connector.py +++ b/pyx/connector.py @@ -76,7 +76,8 @@ class connector_pt(normpath.normpath): pass else: sp = self.intersect(cutpath)[0] - self.normsubpaths = self.split(sp[:1])[0].normsubpaths + if sp: + self.normsubpaths = self.split(sp[:1])[0].normsubpaths ################ @@ -92,7 +93,8 @@ class line_pt(connector_pt): self.box2 = box2 connector_pt.__init__(self, - [path.normsubpath([path.normline_pt(*(self.box1.center+self.box2.center))], closed=0)]) + [path.normsubpath([path.normline_pt(self.box1.center[0], self.box1.center[1], + self.box2.center[0], self.box2.center[1])], closed=0)]) self.omitends(box1, box2) self.shortenpath(boxdists) @@ -332,7 +334,7 @@ class line(line_pt): """a line is the straight connector between the centers of two boxes""" - def __init__(self, box1, box2, boxdists=[0,0]): + def __init__(self, box1, box2, boxdists=(0,0)): line_pt.__init__(self, box1, box2, boxdists=map(unit.topt, boxdists)) diff --git a/pyx/normpath.py b/pyx/normpath.py index 5d60284a..0f7e3057 100644 --- a/pyx/normpath.py +++ b/pyx/normpath.py @@ -1806,6 +1806,8 @@ class normpath: def _split_pt(self, params): """split path at params and return list of normpaths""" + if not params: + return [] # instead of distributing the parameters, we need to keep their # order and collect parameters for splitting of normsubpathitem -- 2.11.4.GIT