mirror of
https://github.com/adafruit/Adafruit-GFX-Library.git
synced 2024-09-19 09:25:58 -04:00
Fix bug w/large GFXcanvas1's (use 32-bit byte counts)
This commit is contained in:
parent
e122c3d20f
commit
5ea4be3ffe
@ -1761,7 +1761,7 @@ const uint8_t PROGMEM GFXcanvas1::GFXclrBit[] = {0x7F, 0xBF, 0xDF, 0xEF,
|
||||
*/
|
||||
/**************************************************************************/
|
||||
GFXcanvas1::GFXcanvas1(uint16_t w, uint16_t h) : Adafruit_GFX(w, h) {
|
||||
uint16_t bytes = ((w + 7) / 8) * h;
|
||||
uint32_t bytes = ((w + 7) / 8) * h;
|
||||
if ((buffer = (uint8_t *)malloc(bytes))) {
|
||||
memset(buffer, 0, bytes);
|
||||
}
|
||||
@ -1887,7 +1887,7 @@ bool GFXcanvas1::getRawPixel(int16_t x, int16_t y) const {
|
||||
/**************************************************************************/
|
||||
void GFXcanvas1::fillScreen(uint16_t color) {
|
||||
if (buffer) {
|
||||
uint16_t bytes = ((WIDTH + 7) / 8) * HEIGHT;
|
||||
uint32_t bytes = ((WIDTH + 7) / 8) * HEIGHT;
|
||||
memset(buffer, color ? 0xFF : 0x00, bytes);
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
name=Adafruit GFX Library
|
||||
version=1.11.4
|
||||
version=1.11.5
|
||||
author=Adafruit
|
||||
maintainer=Adafruit <info@adafruit.com>
|
||||
sentence=Adafruit GFX graphics core library, this is the 'core' class that all our other graphics libraries derive from.
|
||||
|
Loading…
Reference in New Issue
Block a user