|
@@ -3569,15 +3569,17 @@ void ImageDrawLineEx(Image *dst, Vector2 start, Vector2 end, int thick, Color co
|
|
if ((dx != 0) && (abs(dy/dx) < 1))
|
|
if ((dx != 0) && (abs(dy/dx) < 1))
|
|
{
|
|
{
|
|
// Line is more horizontal
|
|
// Line is more horizontal
|
|
|
|
+
|
|
|
|
+ // How many additional lines to draw
|
|
int wy = thick - 1;
|
|
int wy = thick - 1;
|
|
|
|
|
|
- //Draw the main line and lower half
|
|
|
|
|
|
+ // Draw the main line and lower half
|
|
for (int i = 0; i <= ((wy+1)/2); i++)
|
|
for (int i = 0; i <= ((wy+1)/2); i++)
|
|
{
|
|
{
|
|
ImageDrawLine(dst, x1, y1 + i, x2, y2 + i, color); // Draw below the main line
|
|
ImageDrawLine(dst, x1, y1 + i, x2, y2 + i, color); // Draw below the main line
|
|
}
|
|
}
|
|
|
|
|
|
- //Draw the upper half
|
|
|
|
|
|
+ // Draw the upper half
|
|
for (int i = 1; i <= (wy/2); i++)
|
|
for (int i = 1; i <= (wy/2); i++)
|
|
{
|
|
{
|
|
ImageDrawLine(dst, x1, y1 - i, x2, y2 - i, color); // Draw above the main line
|
|
ImageDrawLine(dst, x1, y1 - i, x2, y2 - i, color); // Draw above the main line
|
|
@@ -3586,6 +3588,8 @@ void ImageDrawLineEx(Image *dst, Vector2 start, Vector2 end, int thick, Color co
|
|
else if (dy != 0)
|
|
else if (dy != 0)
|
|
{
|
|
{
|
|
// Line is more vertical or perfectly horizontal
|
|
// Line is more vertical or perfectly horizontal
|
|
|
|
+
|
|
|
|
+ // How many additional lines to draw
|
|
int wx = thick - 1;
|
|
int wx = thick - 1;
|
|
|
|
|
|
//Draw the main line and right half
|
|
//Draw the main line and right half
|
|
@@ -3594,7 +3598,7 @@ void ImageDrawLineEx(Image *dst, Vector2 start, Vector2 end, int thick, Color co
|
|
ImageDrawLine(dst, x1 + i, y1, x2 + i, y2, color); // Draw right of the main line
|
|
ImageDrawLine(dst, x1 + i, y1, x2 + i, y2, color); // Draw right of the main line
|
|
}
|
|
}
|
|
|
|
|
|
- //Draw the the left half
|
|
|
|
|
|
+ // Draw the left half
|
|
for (int i = 1; i <= (wx/2); i++)
|
|
for (int i = 1; i <= (wx/2); i++)
|
|
{
|
|
{
|
|
ImageDrawLine(dst, x1 - i, y1, x2 - i, y2, color); // Draw left of the main line
|
|
ImageDrawLine(dst, x1 - i, y1, x2 - i, y2, color); // Draw left of the main line
|