|
From: Joerg L. <jo...@us...> - 2005-01-31 13:30:31
|
On 31.01.05, André Wobst wrote: > Update of /cvsroot/pyx/pyx/pyx > In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29972 > > Modified Files: > path.py > Log Message: > remove the XXX NOTE TODO and the (WRONG!) moveto from arct_pt Das mit dem moveto kann sein, ist ja auch der XXX code... Nur als Hinweis: test/functional/test_path.py läuft nicht mehr durch. Bezüglich der bbox-Sachen solltest Du insbesondere test_bbox.eps anschauen. Jörg > Index: path.py > =================================================================== > RCS file: /cvsroot/pyx/pyx/pyx/path.py,v > retrieving revision 1.187 > retrieving revision 1.188 > diff -C2 -d -r1.187 -r1.188 > *** path.py 31 Jan 2005 10:13:45 -0000 1.187 > --- path.py 31 Jan 2005 13:04:48 -0000 1.188 > *************** > *** 678,687 **** > self.r_pt = r_pt > > ! def _path(self, context): > ! """returns the path consisting of arc and/or line which corresponds > ! to arct > > ! this is a helper routine for _bbox and _normalized, which both need > ! this path. Note: we don't want to calculate the bbox from a bpath > """ > > --- 678,688 ---- > self.r_pt = r_pt > > ! def _pathitem(self, context): > ! """return pathitem which corresponds to arct in the given context. > > ! The return value is either a arc_pt, a arcn_pt or a line_pt instance. > ! > ! This is a helper routine for _updatecontext, _bbox and _normalized, > ! which will all deligate the work to the constructed pathitem. > """ > > *************** > *** 708,712 **** > yt2_pt = self.y1_pt + dy2_pt*self.r_pt*cotalpha2/l2 > > ! # direction of center of arc > rx_pt = self.x1_pt - 0.5*(xt1_pt+xt2_pt) > ry_pt = self.y1_pt - 0.5*(yt1_pt+yt2_pt) > --- 709,713 ---- > yt2_pt = self.y1_pt + dy2_pt*self.r_pt*cotalpha2/l2 > > ! # direction of center of arc > rx_pt = self.x1_pt - 0.5*(xt1_pt+xt2_pt) > ry_pt = self.y1_pt - 0.5*(yt1_pt+yt2_pt) > *************** > *** 717,724 **** > phi = degrees(math.atan2(ry_pt, rx_pt)) > else: > ! # XXX why is rx_pt/ry_pt and not ry_pt/rx_pt used??? > phi = degrees(math.atan(rx_pt/ry_pt))+180 > > ! # half angular width of arc > deltaphi = 90*(1-alpha/pi) > > --- 718,725 ---- > phi = degrees(math.atan2(ry_pt, rx_pt)) > else: > ! # XXX why is rx_pt/ry_pt and not ry_pt/rx_pt used??? > phi = degrees(math.atan(rx_pt/ry_pt))+180 > > ! # half angular width of arc > deltaphi = 90*(1-alpha/pi) > > *************** > *** 727,753 **** > my_pt = self.y1_pt - ry_pt*self.r_pt/(lr*sin(alpha/2)) > > - # now we are in the position to construct the path > - p = path(moveto_pt(context.x_pt, context.y_pt)) > - > if phi<0: > ! p.append(arc_pt(mx_pt, my_pt, self.r_pt, phi-deltaphi, phi+deltaphi)) > else: > ! p.append(arcn_pt(mx_pt, my_pt, self.r_pt, phi+deltaphi, phi-deltaphi)) > ! > ! return p > > else: > ! # we need no arc, so just return a straight line from context to x1_pt, y1_pt > ! return line_pt(context.x_pt, context.y_pt, self.x1_pt, self.y1_pt) > > def _updatecontext(self, context): > ! self._path(context)[-1]._updatecontext(context) > > def _bbox(self, context): > ! return self._path(context).bbox() > > def _normalized(self, context): > ! # XXX TODO NOTE > ! return self._path(context).normpath().normsubpaths[0].normsubpathitems > > def outputPS(self, file): > --- 728,747 ---- > my_pt = self.y1_pt - ry_pt*self.r_pt/(lr*sin(alpha/2)) > > if phi<0: > ! return arc_pt(mx_pt, my_pt, self.r_pt, phi-deltaphi, phi+deltaphi) > else: > ! return arcn_pt(mx_pt, my_pt, self.r_pt, phi+deltaphi, phi-deltaphi) > > else: > ! return lineto_pt(self.x1_pt, self.y1_pt) > > def _updatecontext(self, context): > ! self._pathitem(context)._updatecontext(context) > > def _bbox(self, context): > ! return self._pathitem(context).bbox() > > def _normalized(self, context): > ! return self._pathitem(context)._normalized(context) > > def outputPS(self, file): > > > > ------------------------------------------------------- > This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting > Tool for open source databases. Create drag-&-drop reports. Save time > by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc. > Download a FREE copy at http://www.intelliview.com/go/osdn_nl > _______________________________________________ > PyX-checkins mailing list > PyX...@li... > https://lists.sourceforge.net/lists/listinfo/pyx-checkins > |