mirror of
https://github.com/adafruit/Adafruit-GFX-Library.git
synced 2024-10-03 18:18:46 -04:00
Merge pull request #45 from Mokolea/getCursor
Get current cursor position
This commit is contained in:
commit
b03b3fcd90
@ -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;
|
||||
}
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user