Do no add rencache a command for empty rectangles

This commit is contained in:
Francesco Abbate 2021-10-10 14:58:51 +02:00
parent cb08c5cbb7
commit 0f8d7f3202
1 changed files with 3 additions and 1 deletions

View File

@ -160,7 +160,9 @@ void rencache_set_clip_rect(RenRect rect) {
void rencache_draw_rect(RenRect rect, RenColor color) {
if (!rects_overlap(screen_rect, rect)) { return; }
if (!rects_overlap(screen_rect, rect) || rect.width == 0 || rect.height == 0) {
return;
}
Command *cmd = push_command(DRAW_RECT, COMMAND_BARE_SIZE);
if (cmd) {
cmd->rect = rect;