Skip to content

Commit ca0ba55

Browse files
committed
Reviewed parameter names, added comment about order
1 parent 236618f commit ca0ba55

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

src/raylib.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1291,7 +1291,7 @@ RLAPI void DrawRectangleRec(Rectangle rec, Color color);
12911291
RLAPI void DrawRectanglePro(Rectangle rec, Vector2 origin, float rotation, Color color); // Draw a color-filled rectangle with pro parameters
12921292
RLAPI void DrawRectangleGradientV(int posX, int posY, int width, int height, Color top, Color bottom); // Draw a vertical-gradient-filled rectangle
12931293
RLAPI void DrawRectangleGradientH(int posX, int posY, int width, int height, Color left, Color right); // Draw a horizontal-gradient-filled rectangle
1294-
RLAPI void DrawRectangleGradientEx(Rectangle rec, Color topLeft, Color bottomLeft, Color bottomRight, Color topRight); // Draw a gradient-filled rectangle with custom vertex colors, counter-clockwise color order
1294+
RLAPI void DrawRectangleGradientEx(Rectangle rec, Color col1, Color col2, Color col3, Color col4); // Draw a gradient-filled rectangle with custom vertex colors, counter-clockwise color order
12951295
RLAPI void DrawRectangleLines(int posX, int posY, int width, int height, Color color); // Draw rectangle outline
12961296
RLAPI void DrawRectangleLinesEx(Rectangle rec, float thick, Color color); // Draw rectangle outline with line thickness
12971297
RLAPI void DrawRectangleRounded(Rectangle rec, float roundness, int segments, Color color); // Draw rectangle with rounded edges

src/rshapes.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -547,8 +547,8 @@ void DrawRectangleGradientH(int posX, int posY, int width, int height, Color lef
547547
DrawRectangleGradientEx((Rectangle){ (float)posX, (float)posY, (float)width, (float)height }, left, left, right, right);
548548
}
549549

550-
// Draw a gradient-filled rectangle
551-
void DrawRectangleGradientEx(Rectangle rec, Color topLeft, Color bottomLeft, Color bottomRight, Color topRight)
550+
// Draw a gradient-filled rectangle with custom vertex colors, counter-clockwise color order
551+
void DrawRectangleGradientEx(Rectangle rec, Color col1, Color col2, Color col3, Color col4)
552552
{
553553
rlSetTexture(GetShapesTexture().id);
554554
Rectangle shapeRect = GetShapesTextureRectangle();
@@ -557,19 +557,19 @@ void DrawRectangleGradientEx(Rectangle rec, Color topLeft, Color bottomLeft, Col
557557
rlNormal3f(0.0f, 0.0f, 1.0f);
558558

559559
// NOTE: Default raylib font character 95 is a white square
560-
rlColor4ub(topLeft.r, topLeft.g, topLeft.b, topLeft.a);
560+
rlColor4ub(col1.r, col1.g, col1.b, col1.a);
561561
rlTexCoord2f(shapeRect.x/texShapes.width, shapeRect.y/texShapes.height);
562562
rlVertex2f(rec.x, rec.y);
563563

564-
rlColor4ub(bottomLeft.r, bottomLeft.g, bottomLeft.b, bottomLeft.a);
564+
rlColor4ub(col2.r, col2.g, col2.b, col2.a);
565565
rlTexCoord2f(shapeRect.x/texShapes.width, (shapeRect.y + shapeRect.height)/texShapes.height);
566566
rlVertex2f(rec.x, rec.y + rec.height);
567567

568-
rlColor4ub(bottomRight.r, bottomRight.g, bottomRight.b, bottomRight.a);
568+
rlColor4ub(col3.r, col3.g, col3.b, col3.a);
569569
rlTexCoord2f((shapeRect.x + shapeRect.width)/texShapes.width, (shapeRect.y + shapeRect.height)/texShapes.height);
570570
rlVertex2f(rec.x + rec.width, rec.y + rec.height);
571571

572-
rlColor4ub(topRight.r, topRight.g, topRight.b, topRight.a);
572+
rlColor4ub(col4.r, col4.g, col4.b, col4.a);
573573
rlTexCoord2f((shapeRect.x + shapeRect.width)/texShapes.width, shapeRect.y/texShapes.height);
574574
rlVertex2f(rec.x + rec.width, rec.y);
575575
rlEnd();

0 commit comments

Comments
 (0)