Skip to content

Commit dfa6443

Browse files
committed
Merge pull request #20 from jrcutler/master
Make "get" methods const
2 parents 6b4a8f0 + 2b3e522 commit dfa6443

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
@@ -467,7 +467,7 @@ void Adafruit_GFX::setTextWrap(boolean w) {
467467
wrap = w;
468468
}
469469

470-
uint8_t Adafruit_GFX::getRotation(void) {
470+
uint8_t Adafruit_GFX::getRotation(void) const {
471471
return rotation;
472472
}
473473

@@ -488,11 +488,11 @@ void Adafruit_GFX::setRotation(uint8_t x) {
488488
}
489489

490490
// Return the size of the display (per current rotation)
491-
int16_t Adafruit_GFX::width(void) {
491+
int16_t Adafruit_GFX::width(void) const {
492492
return _width;
493493
}
494494

495-
int16_t Adafruit_GFX::height(void) {
495+
int16_t Adafruit_GFX::height(void) const {
496496
return _height;
497497
}
498498

Adafruit_GFX.h

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

68-
int16_t
69-
height(void),
70-
width(void);
68+
int16_t height(void) const;
69+
int16_t width(void) const;
7170

72-
uint8_t getRotation(void);
71+
uint8_t getRotation(void) const;
7372

7473
protected:
7574
const int16_t

0 commit comments

Comments
 (0)