@Override public Triangle refresh() { m_list.clear(); return this; }
@Override public BoundingBox getBoundingBox() { if (m_list.size() < 1) { parse(getAttributes()); } return m_list.getBoundingBox(); }
public final void push(final PathPartEntryJSO part) { resetBoundingBox(); if (false == m_mov) { M(0, 0); } m_jso.push(part); }
m_list.M(points[0].x, points[0].y).L(points[1].x, points[1].y); m_list.M(points[0].x, points[0].y); m_list.Q(point.x, point.y, points[1].x, points[1].y); m_list.L(points[i + 1].x, points[i + 1].y); m_list.C(p1.x, p1.y, p2.x, p2.y, points[i + 1].x, points[i + 1].y); m_list.Q(point.x, point.y, points[i + 1].x, points[i + 1].y); m_list.Z();
private static final void drawLines(final PathPartList list, final Point2D p0, final Point2D p2, final Point2D p4, double radius) { final Point2D p1 = new Point2D(); final Point2D p3 = new Point2D(); radius = adjustStartEndOffsets(p0, p2, p4, radius, p1, p3); if (list.size() == 0) { list.M(p1.getX(), p1.getY()); } else { list.L(p1.getX(), p1.getY()); } list.A(p2.getX(), p2.getY(), p3.getX(), p3.getY(), radius); }
private final PathPartList getOrIncrementList() { final NFastArrayList<PathPartList> list = getPathPartListArray(); if (list.size() < 1) { PathPartList path = new PathPartList(); list.add(path); return path; } PathPartList path = list.get(list.size() - 1); if (path.size() < 1) { return path; } if (path.isClosed()) { path = new PathPartList(); list.add(path); } return path; }
public MultiPath L(final double x, final double y) { getOrIncrementList().L(x, y); return this; }
public MultiPath M(final double x, final double y) { getOrIncrementList().M(x, y); return this; }
public final PathPartList deep() { final JSONValue value = JSONParser.parseStrict(toJSONString()); if (null == value) { return null; } final JSONArray array = value.isArray(); if (null != array) { final PathPartList make = new PathPartList((PathPartListJSO) array.getJavaScriptObject(), false); make.m_fin = m_fin; make.m_mov = m_mov; make.m_cpx = m_cpx; make.m_cpy = m_cpy; return make; } return null; }
@Override protected boolean prepare(final Context2D context, final Attributes attr, final double alpha) { final double radius = getCornerRadius(); if (radius != 0) { m_cornerPoints = new NFastArrayList<>(); for (int i = 0; i < m_points.size(); i++) { final PathPartList baseList = m_points.get(i); final Point2DArray basePoints = baseList.getPoints(); final PathPartList cornerList = new PathPartList(); Geometry.drawArcJoinedLines(cornerList, baseList, basePoints, radius); m_cornerPoints.add(cornerList); } } return true; }
public MultiPath Q(final double cx, final double cy, final double x, final double y) { getOrIncrementList().Q(cx, cy, x, y); return this; }
public MultiPath C(final double x1, final double y1, final double x2, final double y2, final double x, final double y) { getOrIncrementList().C(x1, y1, x2, y2, x, y); return this; }
public MultiPath A(final double rx, final double ry, final double ps, final double fa, final double fs, final double x, final double y) { getOrIncrementList().A(rx, ry, ps, fa, fs, x, y); return this; }
public MultiPath H(final double x) { getOrIncrementList().H(x); return this; }
@Override public BoundingBox getBoundingBox() { return m_list.getBoundingBox(); }
@Override protected boolean prepare(final Context2D context, Attributes attr, double alpha) { if (m_list.size() < 1) { return false; } m_fill = context.path(m_list); return true; }
public PathPartListPathClipper(final PathClipperJSO clip) { super(clip); if (null == getValue()) { m_path = null; } else { m_path = new PathPartList((PathPartListJSO) getValue().cast(), true); } }
m_list.M(points[0].x, points[0].y).L(points[1].x, points[1].y); m_list.M(points[0].x, points[0].y); m_list.Q(point.x, point.y, points[1].x, points[1].y); m_list.L(points[i + 1].x, points[i + 1].y); m_list.C(p1.x, p1.y, p2.x, p2.y, points[i + 1].x, points[i + 1].y); m_list.Q(point.x, point.y, points[i + 1].x, points[i + 1].y); m_list.Z();