public void appendPath(GeneralPath path, BuildHistory hist) { float offx = isRelative ? hist.history[0].x : 0f; float offy = isRelative ? hist.history[0].y : 0f; path.quadTo(kx + offx, ky + offy, x + offx, y + offy); hist.setPointAndKnot(x + offx, y + offy, kx + offx, ky + offy); }
public void appendPath(GeneralPath path, BuildHistory hist) { float offx = isRelative ? hist.history[0].x : 0f; float offy = isRelative ? hist.history[0].y : 0f; path.curveTo(k1x + offx, k1y + offy, k2x + offx, k2y + offy, x + offx, y + offy); hist.setPointAndKnot(x + offx, y + offy, k2x + offx, k2y + offy); }
public void appendPath(GeneralPath path, BuildHistory hist) { float offx = isRelative ? hist.history[0].x : 0f; float offy = isRelative ? hist.history[0].y : 0f; float oldKx = hist.history.length >= 2 ? hist.history[1].x : hist.history[0].x; float oldKy = hist.history.length >= 2 ? hist.history[1].y : hist.history[0].y; float oldX = hist.history[0].x; float oldY = hist.history[0].y; //Calc knot as reflection of old knot float kx = oldX * 2f - oldKx; float ky = oldY * 2f - oldKy; path.quadTo(kx, ky, x + offx, y + offy); hist.setPointAndKnot(x + offx, y + offy, kx, ky); }
public void appendPath(GeneralPath path, BuildHistory hist) { float offx = isRelative ? hist.history[0].x : 0f; float offy = isRelative ? hist.history[0].y : 0f; float oldKx = hist.history.length >= 2 ? hist.history[1].x : hist.history[0].x; float oldKy = hist.history.length >= 2 ? hist.history[1].y : hist.history[0].y; float oldX = hist.history[0].x; float oldY = hist.history[0].y; //Calc knot as reflection of old knot float k1x = oldX * 2f - oldKx; float k1y = oldY * 2f - oldKy; path.curveTo(k1x, k1y, k2x + offx, k2y + offy, x + offx, y + offy); hist.setPointAndKnot(x + offx, y + offy, k2x + offx, k2y + offy); }