added gradient shader logic to trapezoids
This commit is contained in:
+2
-2
@@ -22,7 +22,7 @@ namespace UwU {
|
||||
int16_t d = (2 * dy) - dx;
|
||||
int16_t y = iy0;
|
||||
for (int16_t x = ix0; x < ix1; x++) {
|
||||
buffer.drawPixel(Coord2((uint16_t)x, (uint16_t)y), color);
|
||||
buffer.drawPixel((uint16_t)x, (uint16_t)y, color);
|
||||
if (d > 0) {
|
||||
y += yi;
|
||||
d += (2 * (dy - dx));
|
||||
@@ -45,7 +45,7 @@ namespace UwU {
|
||||
int16_t d = (2 * dx) - dy;
|
||||
int16_t x = ix0;
|
||||
for (int16_t y = iy0; y < iy1; y++) {
|
||||
buffer.drawPixel(Coord2((uint16_t)x, (uint16_t)y), color);
|
||||
buffer.drawPixel((uint16_t)x, (uint16_t)y, color);
|
||||
if (d > 0) {
|
||||
x += xi;
|
||||
d += (2 * (dx - dy));
|
||||
|
||||
Reference in New Issue
Block a user