cancel
Showing results for 
Search instead for 
Did you mean: 

Is TextArea::getBaselineY() not implemented by desing ?

ferro
Senior III

Hi,

As the TextArea::setBaselineY() is not mirrored with a getter TextArea::getBaselineY() I wonder whether it is a design decision or simply overlook.

Thanks

2 REPLIES 2
Osman SOYKURT
ST Employee

Hello ferro,

Actually the setBaseline() function will move the widget entirely, so getting a value like this would not be different than getting your widget Y-position. This is not the same for the setIndentation() function however, where only the text will "move" and not the widget.

/Osman

Osman SOYKURT
ST Software Developer | TouchGFX
ferro
Senior III

Hi @Osman SOYKURT​ 

"Actually the setBaseline() function will move the widget entirely"

Yes ! I realized that while tinkering with a vertical alignment.

"getting a value like this [ getBaseline () ] would not be different than getting your widget Y-position"

I think the hypothetical getBaseline () sbould differ from getY() by getTypedText().getFont()->getBaseline() as

//TextArea.hpp
 
virtual void TextArea::setBaselineY(int16_t baselineY)
{
    setY(baselineY - getTypedText().getFont()->getBaseline());
}