Pārlūkot izejas kodu

Fix `ImageDrawRectangleRec` (#3721)

pull/3727/head
Le Juez Victor pirms 1 gada
committed by GitHub
vecāks
revīzija
746f129bfe
Šim parakstam datu bāzē netika atrasta zināma atslēga GPG atslēgas ID: 4AEE18F83AFDEB23
1 mainītis faili ar 2 papildinājumiem un 2 dzēšanām
  1. +2
    -2
      src/rtextures.c

+ 2
- 2
src/rtextures.c Parādīt failu

@ -3562,8 +3562,8 @@ void ImageDrawRectangleRec(Image *dst, Rectangle rec, Color color)
if ((dst->data == NULL) || (dst->width == 0) || (dst->height == 0)) return;
// Security check to avoid drawing out of bounds in case of bad user data
if (rec.x < 0) { rec.width -= rec.x; rec.x = 0; }
if (rec.y < 0) { rec.height -= rec.y; rec.y = 0; }
if (rec.x < 0) { rec.width += rec.x; rec.x = 0; }
if (rec.y < 0) { rec.height += rec.y; rec.y = 0; }
if (rec.width < 0) rec.width = 0;
if (rec.height < 0) rec.height = 0;

Notiek ielāde…
Atcelt
Saglabāt