private void walk(PathWalker walker, double[] points, int l, bool closed) { walker.beginSubPath(closed); for (int i = 0; i < l; i += 2) { walker.lineTo(points[i], points[i + 1]); } walker.endSubPath(); }
/// <summary> Walks the given walker through this subpath. /// /// </summary> /// <param name="walker">the walker. /// </param> /// <param name="error">the error matrix. /// </param> public virtual void walk(PathWalker walker, System.Drawing.Drawing2D.Matrix errorMatrix, double error) { System.Drawing.PointF position = new System.Drawing.PointF((float)startX, (float)startY); walker.beginSubPath(closed); walker.lineTo(startX, startY); for (int i = 0; i < segments.Length; i++) { //UPGRADE_NOTE: ref keyword was added to struct-type parameters. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1303_3"' segments[i].walk(walker, ref position, errorMatrix, error); } walker.endSubPath(); }
//UPGRADE_NOTE: ref keyword was added to struct-type parameters. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1303_3"' private void iterate(PathWalker walker, ref System.Drawing.PointF position, System.Drawing.Drawing2D.Matrix errorMatrix, double error, double t1, ref System.Drawing.PointF p1, double t2, ref System.Drawing.PointF p2) { double tc = (t1 + t2) / 2.0; //UPGRADE_NOTE: ref keyword was added to struct-type parameters. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1303_3"' System.Drawing.PointF pc = calcPoint(tc, ref position); double ex, ey, tex, tey; ex = (double) pc.X - ((double) p1.X + (double) p2.X) / 2.0; ey = (double) pc.Y - ((double) p1.Y + (double) p2.Y) / 2.0; tex = (float) errorMatrix.Elements.GetValue(0) * ex + (float) errorMatrix.Elements.GetValue(2) * ey; tey = (float) errorMatrix.Elements.GetValue(1) * ex + (float) errorMatrix.Elements.GetValue(3) * ey; if (tex * tex + tey * tey >= error * error) { //UPGRADE_NOTE: ref keyword was added to struct-type parameters. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1303_3"' iterate(walker, ref position, errorMatrix, error, t1, ref p1, tc, ref pc); //UPGRADE_NOTE: ref keyword was added to struct-type parameters. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1303_3"' iterate(walker, ref position, errorMatrix, error, tc, ref pc, t2, ref p2); } else { walker.lineTo(p2.X, p2.Y); } }
//UPGRADE_NOTE: ref keyword was added to struct-type parameters. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1303_3"' public virtual void walk(PathWalker walker, ref System.Drawing.PointF position, System.Drawing.Drawing2D.Matrix errorMatrix, double error) { walker.lineTo(x, y); position.X = (float)x; position.Y = (float)y; }