Skip to content

Discrepancy between this library and CustomPainter cubicTo #24

Open
@netgfx

Description

@netgfx

I'm using this library to create a path that consists of multiple curves, the issue is that when I draw the path using CustomPainter cubicTo

var cubic = GameObject.shared.cubicBeziers;
    final Path path = Path();
    for (var i = 0; i < cubic.length; i++) {
      drawCurve(cubic[i], path);
    }
    path.close();
    canvas.drawPath(path, _paint);
    
    void drawCurve(CubicBezier curve, Path path) {
  
    vectorMath.Vector2 point0 = curve.startPoint;
    vectorMath.Vector2 point1 = curve.points[1];
    vectorMath.Vector2 point2 = curve.points[2];
    vectorMath.Vector2 point3 = curve.endPoint;
    path.moveTo(point0.x, point0.y);

    path.cubicTo(point1.x, point1.y, point2.x, point2.y, point3.x, point3.y);

  }

And when I follow the path via percentages, they have a difference, especially on the y axis
The issue can be seen here:

ezgif-5-be09c688f3

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions