improved rectangle

This commit is contained in:
Emanuele Trabattoni
2021-06-06 19:54:21 +02:00
parent 54fabc151d
commit d910980ede
4 changed files with 37 additions and 19 deletions

View File

@@ -9,7 +9,8 @@ namespace Render {
_screenSize(size),
_screenBufferBackground(nullptr),
_screenBufferForeground(nullptr),
_rotation(rot)
_rotation(rot),
_full(true)
{
int rv;
_bufferDim = (_screenSize.x >> 3) * _screenSize.y;
@@ -49,7 +50,12 @@ namespace Render {
if (d != nullptr)
d->render();
};
if (!_full)
EPD_2IN9_V2_Display_Partial(_screenBufferBackground);
else {
EPD_2IN9_V2_Display(_screenBufferBackground);
_full = false;
}
}
void Mare::clearBuffer(uint8_t* buffer, uint16_t len, Color col){
@@ -126,7 +132,7 @@ namespace Render {
void Mare::clearScreen() {
EPD_2IN9_V2_Clear();
clearBuffer(_screenBufferBackground, _bufferDim, Color::White);
EPD_2IN9_V2_Display(_screenBufferBackground);
_full = true;
}
}