Fixed monochrome example 2.

This commit is contained in:
nitko12 2020-08-26 09:27:02 +02:00
parent e275a357e8
commit 31a31fb4e8
2 changed files with 4 additions and 8 deletions

View File

@ -519,7 +519,6 @@ void Inkplate::drawElipse(int rx, int ry,
int xc, int yc, int xc, int yc,
int c) int c)
{ {
selectDisplayMode(INKPLATE_3BIT);
float dx, dy, d1, d2, x, y; float dx, dy, d1, d2, x, y;
x = 0; x = 0;
y = ry; y = ry;
@ -583,7 +582,6 @@ void Inkplate::fillElipse(int rx, int ry,
int xc, int yc, int xc, int yc,
int c) int c)
{ {
selectDisplayMode(INKPLATE_3BIT);
int hh = ry * ry; int hh = ry * ry;
int ww = rx * rx; int ww = rx * rx;
int hhww = hh * ww; int hhww = hh * ww;
@ -612,7 +610,6 @@ void Inkplate::fillElipse(int rx, int ry,
void Inkplate::fillPolygon(int *x, int *y, int n, int color) void Inkplate::fillPolygon(int *x, int *y, int n, int color)
{ {
selectDisplayMode(INKPLATE_3BIT);
int tx[100], ty[100]; int tx[100], ty[100];
triangulate.triangulate(x, y, n, tx, ty); triangulate.triangulate(x, y, n, tx, ty);
@ -628,7 +625,6 @@ void Inkplate::fillPolygon(int *x, int *y, int n, int color)
void Inkplate::drawPolygon(int *x, int *y, int n, int color) void Inkplate::drawPolygon(int *x, int *y, int n, int color)
{ {
selectDisplayMode(INKPLATE_3BIT);
for (int i = 0; i < n; ++i) for (int i = 0; i < n; ++i)
drawLine(x[i], y[i], x[(i + 1) % n], y[(i + 1) % n], color); drawLine(x[i], y[i], x[(i + 1) % n], y[(i + 1) % n], color);
} }

View File

@ -363,7 +363,7 @@ void loop()
// Draws an elipse with x radius, y radius, center x, center y and color // Draws an elipse with x radius, y radius, center x, center y and color
display.clearDisplay(); display.clearDisplay();
display.drawElipse(100, 200, 400, 300, 0); display.drawElipse(100, 200, 400, 300, BLACK);
displayCurrentAction("Drawing an elipse"); displayCurrentAction("Drawing an elipse");
display.display(); display.display();
@ -371,7 +371,7 @@ void loop()
// Fills an elipse with x radius, y radius, center x, center y and color // Fills an elipse with x radius, y radius, center x, center y and color
display.clearDisplay(); display.clearDisplay();
display.fillElipse(100, 200, 400, 300, 0); display.fillElipse(100, 200, 400, 300, BLACK);
displayCurrentAction("Drawing a filled elipse"); displayCurrentAction("Drawing a filled elipse");
display.display(); display.display();
@ -398,7 +398,7 @@ void loop()
// Draws a polygon, from x and y coordinate arrays of n points in color c // Draws a polygon, from x and y coordinate arrays of n points in color c
display.clearDisplay(); display.clearDisplay();
display.drawPolygon(xt, yt, n, 0); display.drawPolygon(xt, yt, n, BLACK);
displayCurrentAction("Drawing a polygon"); displayCurrentAction("Drawing a polygon");
display.display(); display.display();
@ -408,7 +408,7 @@ void loop()
// Points need to be counter clockwise sorted // Points need to be counter clockwise sorted
// Method can be quite slow for now, probably will improve // Method can be quite slow for now, probably will improve
display.clearDisplay(); display.clearDisplay();
display.fillPolygon(xt, yt, n, 0); display.fillPolygon(xt, yt, n, BLACK);
displayCurrentAction("Drawing a filled polygon"); displayCurrentAction("Drawing a filled polygon");
display.display(); display.display();