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

Method isStaticText

lib/YAWidgets/src/TextWidget.cpp:400–428  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

398}
399
400bool TextWidget::isStaticText(YAGfx& gfx, uint16_t textBoxWidth, uint16_t textBoxHeight) const
401{
402 bool isStatic = false;
403
404 /* Single line text widget? */
405 if (1U >= getLineCount())
406 {
407 /* As long as the text box is smaller than the available width,
408 * the text can be static shown (no scrolling).
409 */
410 if (gfx.getWidth() >= textBoxWidth)
411 {
412 isStatic = true;
413 }
414 }
415 /* Multi-line text widget */
416 else
417 {
418 /* As long as the text box is smaller than the available height,
419 * the text can be static shown (no scrolling).
420 */
421 if (gfx.getHeight() >= textBoxHeight)
422 {
423 isStatic = true;
424 }
425 }
426
427 return isStatic;
428}
429
430void TextWidget::prepareNewText(YAGfx& gfx)
431{

Callers

nothing calls this directly

Calls 2

getWidthMethod · 0.45
getHeightMethod · 0.45

Tested by

no test coverage detected