CCDraw: try to avoid rendering with bad dimensions

This commit is contained in:
2016-12-08 09:30:33 +01:00
parent 9fe560fa53
commit bd5e82fdc4

View File

@@ -668,6 +668,8 @@ void CCDraw::kill(const fb_pixel_t& bg_color, const int& corner_radius, const in
int r = v_fbdata[i].r; int r = v_fbdata[i].r;
if (corner_radius > -1) if (corner_radius > -1)
r = corner_radius; r = corner_radius;
if (v_fbdata[i].dx > 0 && v_fbdata[i].dy > 0){
frameBuffer->paintBoxRel(v_fbdata[i].x, frameBuffer->paintBoxRel(v_fbdata[i].x,
v_fbdata[i].y, v_fbdata[i].y,
v_fbdata[i].dx, v_fbdata[i].dx,
@@ -675,6 +677,9 @@ void CCDraw::kill(const fb_pixel_t& bg_color, const int& corner_radius, const in
bg_color, bg_color,
r, r,
corner_type); corner_type);
}else
dprintf(DEBUG_NORMAL, "\033[33m[CCDraw][%s - %d], WARNING! render with bad dimensions [dx = %d dy = %d]\033[0m\n", __func__, __LINE__, v_fbdata[i].dx, v_fbdata[i].dy );
if (v_fbdata[i].frame_thickness) if (v_fbdata[i].frame_thickness)
frameBuffer->paintBoxFrame(v_fbdata[i].x, frameBuffer->paintBoxFrame(v_fbdata[i].x,
v_fbdata[i].y, v_fbdata[i].y,