You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have found a bug in src/ev3c_lcd.c because of that rectangle frames which aren't squares are only half-drawed (that means, the line below and right aren't drawed).
I found the reason of this bug: in line 258, 264, 273 and 279 are the variables w and h (width and height) interchanged.
The fixed ev3_rectangle_lcd_out is:
voidev3_rectangle_lcd_out(int32_tx,int32_ty,int32_tw,int32_th,int32_tbit)
{
int32_ta;
int32_tminx=x;
int32_tminy=y;
int32_tmaxx=x+w;
int32_tmaxy=y+h;
if (minx >= (int32_t)EV3_X_LCD)
return;
if (miny >= (int32_t)EV3_Y_LCD)
return;
if (maxx<0)
return;
if (maxy<0)
return;
if (minx<0)
minx=0;
if (miny<0)
miny=0;
if (maxx >= EV3_X_LCD)
maxx=EV3_X_LCD-1;
if (maxy >= EV3_Y_LCD)
maxy=EV3_Y_LCD-1;
if (bit)
{
if (y==miny)
for (a=minx; a <= maxx; a++)
EV3_PIXEL_SET(a,miny);
if (y+h==maxy)
for (a=minx; a <= maxx; a++)
EV3_PIXEL_SET(a,maxy);
if (x==minx)
for (a=miny+1; a <= maxy-1; a++)
EV3_PIXEL_SET(minx,a);
if (x+w==maxx)
for (a=miny+1; a <= maxy-1; a++)
EV3_PIXEL_SET(maxx,a);
}
else
{
if (y==miny)
for (a=minx; a <= maxx; a++)
EV3_PIXEL_UNSET(a,miny);
if (y+h==maxy)
for (a=minx; a <= maxx; a++)
EV3_PIXEL_UNSET(a,maxy);
if (x==minx)
for (a=miny+1; a <= maxy-1; a++)
EV3_PIXEL_UNSET(minx,a);
if (x+w==maxx)
for (a=miny+1; a <= maxy-1; a++)
EV3_PIXEL_UNSET(maxx,a);
}
}
Remark that if (y+w == maxy) is changed to if (y+h == maxy) and if (x+h == maxx) is changed to if (x+w == maxx).
The text was updated successfully, but these errors were encountered:
I have found a bug in src/ev3c_lcd.c because of that rectangle frames which aren't squares are only half-drawed (that means, the line below and right aren't drawed).
I found the reason of this bug: in line 258, 264, 273 and 279 are the variables
w
andh
(width and height) interchanged.The fixed
ev3_rectangle_lcd_out
is:Remark that
if (y+w == maxy)
is changed toif (y+h == maxy)
andif (x+h == maxx)
is changed toif (x+w == maxx)
.The text was updated successfully, but these errors were encountered: