mirror of
https://github.com/stasenso/rp_pico_test.git
synced 2026-06-26 21:42:44 +03:00
Grid added
This commit is contained in:
@@ -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));
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user