mirror of
https://gitee.com/idea4good/GuiLite.git
synced 2025-06-07 23:57:20 +08:00
Show "X" when lattice/font not found
This commit is contained in:
parent
144993f2d7
commit
e4d73bf327
@ -161,14 +161,16 @@ int c_word::draw_single_char(c_surface* surface, int z_order, unsigned int utf8_
|
|||||||
error_color = GL_RGB(255, 0, 0);
|
error_color = GL_RGB(255, 0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
//lattice/font not found, draw mosaic
|
//lattice/font not found, draw "X"
|
||||||
int len = 16;
|
int len = 16;
|
||||||
for (int y_ = 0; y_ < len; y_++)
|
for (int y_ = 0; y_ < len; y_++)
|
||||||
{
|
{
|
||||||
for (int x_ = 0; x_ < len; x_++)
|
for (int x_ = 0; x_ < len; x_++)
|
||||||
{
|
{
|
||||||
((y_ % 4) == 0) ? surface->draw_pixel((x + x_), (y + y_), 0, z_order) :
|
int diff = (x_ - y_);
|
||||||
surface->draw_pixel((x + x_), (y + y_), error_color, z_order);
|
int sum = (x_ + y_);
|
||||||
|
(diff == 0 || diff == -1 || diff == 1 || sum == len || sum == (len - 1) || sum == (len + 1)) ?
|
||||||
|
surface->draw_pixel((x + x_), (y + y_), error_color, z_order) : surface->draw_pixel((x + x_), (y + y_), 0, z_order);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return len;
|
return len;
|
||||||
|
Loading…
Reference in New Issue
Block a user