mirror of
https://github.com/adafruit/Adafruit-GFX-Library.git
synced 2024-10-03 18:18:46 -04:00
Get current cursor position
This commit is contained in:
parent
b346ad0df5
commit
7a3f84e966
@ -466,6 +466,14 @@ void Adafruit_GFX::setCursor(int16_t x, int16_t y) {
|
|||||||
cursor_y = 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) {
|
void Adafruit_GFX::setTextSize(uint8_t s) {
|
||||||
textsize = (s > 0) ? s : 1;
|
textsize = (s > 0) ? s : 1;
|
||||||
}
|
}
|
||||||
|
@ -72,6 +72,10 @@ class Adafruit_GFX : public Print {
|
|||||||
|
|
||||||
uint8_t getRotation(void) const;
|
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:
|
protected:
|
||||||
const int16_t
|
const int16_t
|
||||||
WIDTH, HEIGHT; // This is the 'raw' display w/h - never changes
|
WIDTH, HEIGHT; // This is the 'raw' display w/h - never changes
|
||||||
|
Loading…
x
Reference in New Issue
Block a user