Grid added

This commit is contained in:
Stanislav N Mikhailov
2025-01-06 12:08:07 +03:00
parent 4c4a500f6d
commit 1726b92ae4
3 changed files with 22 additions and 3 deletions
+18
View File
@@ -64,4 +64,22 @@ void draw_bezier(const int *points_x, const int *points_y, size_t num_points, ui
// Установка пикселя на экране
set_pixel((int)(x + 0.5f), (int)(y + 0.5f), color);
}
}
void grid (uint16_t x, uint16_t y, uint16_t step, uint16_t color){
for (uint16_t vgrid = x; vgrid < WIDTH; vgrid+=step)
{
for (uint16_t hgrid = 0; hgrid< HEIGHT; hgrid++)
{
set_pixel(vgrid,hgrid,reverse(color));
}
}
for (uint16_t hgrid = y; hgrid< HEIGHT; hgrid+=step)
{
for (uint16_t vgrid = 0; vgrid < WIDTH; vgrid++)
{
set_pixel(vgrid,hgrid,reverse(color));
}
}
}