MCPcopy Create free account
hub / github.com/BlueAndi/Pixelix / alignTextVertical

Method alignTextVertical

lib/YAWidgets/src/TextWidget.cpp:358–386  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

356}
357
358void TextWidget::alignTextVertical()
359{
360 /* Vertical alignment is supported for
361 * - Static text
362 * - Text scrolling from left to right
363 */
364 if ((false == m_scrollCtrl.isEnabled()) ||
365 ((true == m_scrollCtrl.isEnabled()) && (ScrollController::DIRECTION_HORIZONTAL == m_scrollCtrl.getDirection())))
366 {
367 switch (m_vAlign)
368 {
369 case Alignment::Vertical::VERTICAL_TOP:
370 m_vAlignPosY = 0;
371 break;
372
373 case Alignment::Vertical::VERTICAL_CENTER:
374 m_vAlignPosY = (m_canvas.getHeight() - m_textHeight) / 2;
375 break;
376
377 case Alignment::Vertical::VERTICAL_BOTTOM:
378 m_vAlignPosY = m_canvas.getHeight() - m_textHeight;
379 break;
380
381 default:
382 m_vAlignPosY = 0;
383 break;
384 }
385 }
386}
387
388uint16_t TextWidget::getLineCount() const
389{

Callers

nothing calls this directly

Calls 3

getDirectionMethod · 0.80
isEnabledMethod · 0.45
getHeightMethod · 0.45

Tested by

no test coverage detected