From 676f83ca7a9a766d246a98be7d8d2f232a259d8e Mon Sep 17 00:00:00 2001 From: Omar Ali Hassan <36759605+OmarAli3@users.noreply.github.com> Date: Mon, 30 Mar 2020 12:17:59 +0200 Subject: [PATCH 1/3] add function to clear specific point --- src/ArduinoGraphics.cpp | 5 +++++ src/ArduinoGraphics.h | 1 + 2 files changed, 6 insertions(+) diff --git a/src/ArduinoGraphics.cpp b/src/ArduinoGraphics.cpp index 8ed68a0..852c273 100644 --- a/src/ArduinoGraphics.cpp +++ b/src/ArduinoGraphics.cpp @@ -96,6 +96,11 @@ void ArduinoGraphics::clear() } } +void ArduinoGraphics::clear(int x, int y) +{ + set(x, y, _backgroundR, _backgroundB, _backgroundG); +} + void ArduinoGraphics::fill(uint8_t r, uint8_t g, uint8_t b) { _fill = true; diff --git a/src/ArduinoGraphics.h b/src/ArduinoGraphics.h index 3386dfa..69166e6 100644 --- a/src/ArduinoGraphics.h +++ b/src/ArduinoGraphics.h @@ -51,6 +51,7 @@ class ArduinoGraphics : public Print { void background(uint8_t r, uint8_t g, uint8_t b); void background(uint32_t color); void clear(); + void clear(int x, int y); //clear specific point void fill(uint8_t r, uint8_t g, uint8_t b); void fill(uint32_t color); void noFill(); From 04aa61b5a337a6a13143fe1d8af1b5c36acb1e20 Mon Sep 17 00:00:00 2001 From: Omar Ali Hassan Date: Wed, 4 Sep 2024 09:38:09 -0700 Subject: [PATCH 2/3] Update src/ArduinoGraphics.h to remove unnecessary comment Co-authored-by: Leonardo Cavagnis <45899760+leonardocavagnis@users.noreply.github.com> --- src/ArduinoGraphics.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ArduinoGraphics.h b/src/ArduinoGraphics.h index 69166e6..6776f86 100644 --- a/src/ArduinoGraphics.h +++ b/src/ArduinoGraphics.h @@ -51,7 +51,7 @@ class ArduinoGraphics : public Print { void background(uint8_t r, uint8_t g, uint8_t b); void background(uint32_t color); void clear(); - void clear(int x, int y); //clear specific point + void clear(int x, int y); void fill(uint8_t r, uint8_t g, uint8_t b); void fill(uint32_t color); void noFill(); From 4572a10257e34de1e5e60b2ea306336e23212eaf Mon Sep 17 00:00:00 2001 From: Omar Ali Date: Wed, 4 Sep 2024 20:00:52 +0300 Subject: [PATCH 3/3] Update API documentation for clear() method --- docs/api.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/api.md b/docs/api.md index 8827301..004b2b6 100644 --- a/docs/api.md +++ b/docs/api.md @@ -202,17 +202,19 @@ YourScreen.endDraw(); #### Description -Clear the screen contents, uses the background colour set in background(). +Clear the screen contents or a specific pixel, uses the background colour set in background(). #### Syntax ``` YourScreen.clear() +YourScreen.clear(x, y) ``` #### Parameters -None +- x: x position of the pixel to clear +- y: y position of the pixel to clear #### Returns