Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose current TextWrap settings via getTextWrap(), getTextWrapX(), and getTextWrapY() #3380

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions TFT_eSPI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2983,6 +2983,26 @@ void TFT_eSPI::setTextWrap(bool wrapX, bool wrapY)
textwrapY = wrapY;
}

/***************************************************************************************
** Function name: getTextWrapX
** Description: Returns current text wrap width setting
***************************************************************************************/
bool TFT_eSPI::getTextWrapX() {
return textwrapX;
}
bool TFT_eSPI::getTextWrap() {
return textwrapX;
}


/***************************************************************************************
** Function name: getTextWrapY
** Description: Returns current text wrap height setting
***************************************************************************************/
bool TFT_eSPI::getTextWrapY() {
return textwrapY;
}


/***************************************************************************************
** Function name: setTextDatum
Expand Down
4 changes: 4 additions & 0 deletions TFT_eSPI.h
Original file line number Diff line number Diff line change
Expand Up @@ -662,6 +662,10 @@ class TFT_eSPI : public Print { friend class TFT_eSprite; // Sprite class has ac
setTextSize(uint8_t size); // Set character size multiplier (this increases pixel size)

void setTextWrap(bool wrapX, bool wrapY = false); // Turn on/off wrapping of text in TFT width and/or height
bool getTextWrapX(); // get current textwrap setting for width
bool getTextWrap(); // get current textwrap setting for width (to match some other graphics libraries)
bool getTextWrapY(); // get current textwrap setting for height


void setTextDatum(uint8_t datum); // Set text datum position (default is top left), see Section 5 above
uint8_t getTextDatum(void);
Expand Down