void Append(float x, float y, PathPointType type, bool compress)
{
byte t = (byte) type;
PointF pt = PointF.Empty;
/* in some case we're allowed to compress identical points */
if (compress && (points.Count > 0)) {
/* points (X, Y) must be identical */
PointF lastPoint = points [points.Count-1];
if ((lastPoint.X == x) && (lastPoint.Y == y)) {
/* types need not be identical but must handle closed subpaths */
PathPointType last_type = (PathPointType) types [types.Count-1];
if ((last_type & PathPointType.CloseSubpath) != PathPointType.CloseSubpath)
return;
}
}
if (start_new_fig)
t = (byte) PathPointType.Start;
/* if we closed a subpath, then start new figure and append */
else if (points.Count > 0) {
type = (PathPointType) types [types.Count-1];
if ((type & PathPointType.CloseSubpath) != 0)
t = (byte)PathPointType.Start;
}
pt.X = x;
pt.Y = y;
points.Add (pt);
types.Add (t);
start_new_fig = false;
}