Skip to main content
ferro
Lead
March 10, 2023
Question

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

  • March 10, 2023
  • 2 replies
  • 764 views

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

This topic has been closed for replies.

2 replies

Osman SOYKURT
ST Technical Moderator
March 14, 2023

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

ST Software Developer | TouchGFX
ferro
ferroAuthor
Lead
March 15, 2023

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());
}