Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Path enhancements #8

Open
3 tasks
yuripourre opened this issue Apr 12, 2021 · 1 comment
Open
3 tasks

Path enhancements #8

yuripourre opened this issue Apr 12, 2021 · 1 comment

Comments

@yuripourre
Copy link
Member

yuripourre commented Apr 12, 2021

Add helper methods:

  • Get firstCurve
  • Move
  • Scale
@yuripourre
Copy link
Member Author

yuripourre commented Apr 12, 2021

Move:

    for (DataCurve curve : path.getCurves()) {
        move(curve.getStart(), x, y);
        move(curve.getEnd(), x, y);
        if (CurveType.QUADRATIC_BEZIER == curve.getType()) {
            QuadraticCurve c = (QuadraticCurve) curve;
            move(c.getControl1(), x, y);
        } else if (CurveType.CUBIC_BEZIER == curve.getType()) {
            CubicCurve c = (CubicCurve) curve;
            move(c.getControl1(), x, y);
            move(c.getControl2(), x, y);
        }
    }

Scale:
// Calculate centroid
// Move to centroid
// Scale
// Move back

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant