浏览代码

Corrected 1px thick issue

Ray 7 年之前
父节点
当前提交
6428317739
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      src/shapes.c

+ 1 - 1
src/shapes.c

@@ -128,7 +128,7 @@ void DrawLineEx(Vector2 startPos, Vector2 endPos, float thick, Color color)
     rlPushMatrix();
         rlTranslatef((float)startPos.x, (float)startPos.y, 0);
         rlRotatef(RAD2DEG*angle, 0, 0, 1);
-        rlTranslatef(0, -thick/2.0f, 0);
+        rlTranslatef(0, (thick > 1.0f) ? -thick/2.0f : -1.0f, 0);
 
         rlBegin(RL_QUADS);
             rlColor4ub(color.r, color.g, color.b, color.a);