Skip to content

Commit 2b3e522

Browse files
committed
Make "get" methods const
1 parent 82e71e0 commit 2b3e522

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

Adafruit_GFX.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,7 @@ void Adafruit_GFX::setTextWrap(boolean w) {
445445
wrap = w;
446446
}
447447

448-
uint8_t Adafruit_GFX::getRotation(void) {
448+
uint8_t Adafruit_GFX::getRotation(void) const {
449449
return rotation;
450450
}
451451

@@ -466,11 +466,11 @@ void Adafruit_GFX::setRotation(uint8_t x) {
466466
}
467467

468468
// Return the size of the display (per current rotation)
469-
int16_t Adafruit_GFX::width(void) {
469+
int16_t Adafruit_GFX::width(void) const {
470470
return _width;
471471
}
472472

473-
int16_t Adafruit_GFX::height(void) {
473+
int16_t Adafruit_GFX::height(void) const {
474474
return _height;
475475
}
476476

Adafruit_GFX.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,10 @@ class Adafruit_GFX : public Print {
6363
virtual void write(uint8_t);
6464
#endif
6565

66-
int16_t
67-
height(void),
68-
width(void);
66+
int16_t height(void) const;
67+
int16_t width(void) const;
6968

70-
uint8_t getRotation(void);
69+
uint8_t getRotation(void) const;
7170

7271
protected:
7372
const int16_t

0 commit comments

Comments
 (0)