Merge pull request #45 from Mokolea/getCursor

Get current cursor position
This commit is contained in:
Paint Your Dragon 2015-06-12 21:34:40 -07:00
commit b03b3fcd90
2 changed files with 12 additions and 0 deletions

View File

@ -466,6 +466,14 @@ void Adafruit_GFX::setCursor(int16_t x, int16_t y) {
cursor_y = y;
}
int16_t Adafruit_GFX::getCursorX(void) const {
return cursor_x;
}
int16_t Adafruit_GFX::getCursorY(void) const {
return cursor_y;
}
void Adafruit_GFX::setTextSize(uint8_t s) {
textsize = (s > 0) ? s : 1;
}

View File

@ -72,6 +72,10 @@ class Adafruit_GFX : public Print {
uint8_t getRotation(void) const;
// get current cursor position (get rotation safe maximum values, using: width() for x, height() for y)
int16_t getCursorX(void) const;
int16_t getCursorY(void) const;
protected:
const int16_t
WIDTH, HEIGHT; // This is the 'raw' display w/h - never changes