Browse Source

Merge pull request #20 from jrcutler/master

Make "get" methods const
Tony DiCola 11 years ago
parent
commit
dfa6443895
2 changed files with 6 additions and 7 deletions
  1. 3 3
      Adafruit_GFX.cpp
  2. 3 4
      Adafruit_GFX.h

+ 3 - 3
Adafruit_GFX.cpp

@@ -467,7 +467,7 @@ void Adafruit_GFX::setTextWrap(boolean w) {
   wrap = w;
 }
 
-uint8_t Adafruit_GFX::getRotation(void) {
+uint8_t Adafruit_GFX::getRotation(void) const {
   return rotation;
 }
 
@@ -488,11 +488,11 @@ void Adafruit_GFX::setRotation(uint8_t x) {
 }
 
 // Return the size of the display (per current rotation)
-int16_t Adafruit_GFX::width(void) {
+int16_t Adafruit_GFX::width(void) const {
   return _width;
 }
  
-int16_t Adafruit_GFX::height(void) {
+int16_t Adafruit_GFX::height(void) const {
   return _height;
 }
 

+ 3 - 4
Adafruit_GFX.h

@@ -65,11 +65,10 @@ class Adafruit_GFX : public Print {
   virtual void   write(uint8_t);
 #endif
 
-  int16_t
-    height(void),
-    width(void);
+  int16_t height(void) const;
+  int16_t width(void) const;
 
-  uint8_t getRotation(void);
+  uint8_t getRotation(void) const;
 
  protected:
   const int16_t