jingwood / d2dlib

A .NET library for hardware-accelerated, high performance, immediate mode rendering via Direct2D.
MIT License
234 stars 40 forks source link

Parameter missing in DrawBeziers #53

Open mystery123sk opened 3 years ago

mystery123sk commented 3 years ago

I believe there is a missing parameter in D2DGraphics.DrawBeziers - first curve starting point. The D2DBezierSegment contains only two control points and end path point (while you need 4 points for cubic bezier). You use the first control point also as a first main point of cubic bezier:

    context->factory->CreatePathGeometry(&path);
    path->Open(&sink);
    //sink->SetFillMode(D2D1_FILL_MODE_WINDING);
    sink->BeginFigure(bezierSegments[0].point1, D2D1_FIGURE_BEGIN_FILLED); //error - here you should add additional parameter as starting point
jingwood commented 3 years ago

DrawBeziers and AddPathBeziers should be improved. relates to #52