diff options
| author | Ray <[email protected]> | 2022-10-02 11:11:13 +0200 |
|---|---|---|
| committer | Ray <[email protected]> | 2022-10-02 11:11:13 +0200 |
| commit | 33e7f7cc59df39021f2c289f44edc25843c8bb75 (patch) | |
| tree | aa9bf9210440f7095b3d8eebf8d15f9759bea00b | |
| parent | 0daaaddeef7668cb2bea02fccfb504c8939fd44c (diff) | |
| download | raylib-33e7f7cc59df39021f2c289f44edc25843c8bb75.tar.gz raylib-33e7f7cc59df39021f2c289f44edc25843c8bb75.zip | |
WARNING: `DrawLineBezier()` implementation needs review #2721
| -rw-r--r-- | src/rshapes.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/rshapes.c b/src/rshapes.c index 0a016eab..f8d9db71 100644 --- a/src/rshapes.c +++ b/src/rshapes.c @@ -175,6 +175,8 @@ void DrawLineBezier(Vector2 startPos, Vector2 endPos, float thick, Color color) current.y = EaseCubicInOut((float)i, startPos.y, endPos.y - startPos.y, (float)BEZIER_LINE_DIVISIONS); current.x = previous.x + (endPos.x - startPos.x)/ (float)BEZIER_LINE_DIVISIONS; + // TODO: Avoid drawing the line by pieces, it generates gaps for big thicks, + // Custom "triangle-strip" implementation should be used, check DrawTriangleStrip() for reference DrawLineEx(previous, current, thick, color); previous = current; @@ -201,6 +203,8 @@ void DrawLineBezierQuad(Vector2 startPos, Vector2 endPos, Vector2 controlPos, fl current.y = a*startPos.y + b*controlPos.y + c*endPos.y; current.x = a*startPos.x + b*controlPos.x + c*endPos.x; + // TODO: Avoid drawing the line by pieces, it generates gaps for big thicks, + // Custom "triangle-strip" implementation should be used, check DrawTriangleStrip() for reference DrawLineEx(previous, current, thick, color); previous = current; @@ -227,6 +231,8 @@ void DrawLineBezierCubic(Vector2 startPos, Vector2 endPos, Vector2 startControlP current.y = a*startPos.y + b*startControlPos.y + c*endControlPos.y + d*endPos.y; current.x = a*startPos.x + b*startControlPos.x + c*endControlPos.x + d*endPos.x; + // TODO: Avoid drawing the line by pieces, it generates gaps for big thicks, + // Custom "triangle-strip" implementation should be used, check DrawTriangleStrip() for reference DrawLineEx(previous, current, thick, color); previous = current; |
