MCPcopy Create free account
hub / github.com/Snapchat/Valdi / makeTextLayout

Method makeTextLayout

snap_drawing/src/snap_drawing/cpp/Layers/TextLayer.cpp:478–544  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

476 setNeedsTextLayout();
477 }
478 }
479}
480
481double TextLayer::getMinimumScaleFactor() const {
482 return _minimumScaleFactor;
483}
484
485void TextLayer::setLineHeight(Scalar lineHeight) {
486 if (_lineHeight != lineHeight) {
487 _lineHeight = lineHeight;
488 setNeedsTextLayout();
489 }
490}
491
492Scalar TextLayer::getLineHeight() const {
493 return _lineHeight;
494}
495
496void TextLayer::setLineHeightAbsolute(Scalar lineHeightAbsolute) {
497 if (_usesLineHeightAbsolute != true || _lineHeightAbsolute != lineHeightAbsolute) {
498 _usesLineHeightAbsolute = true;
499 _lineHeightAbsolute = lineHeightAbsolute;
500 setNeedsTextLayout();
501 }
502}
503
504void TextLayer::resetLineHeightAbsolute() {
505 if (_usesLineHeightAbsolute) {
506 _usesLineHeightAbsolute = false;
507 _lineHeightAbsolute = 0.0f;
508 setNeedsTextLayout();
509 }
510}
511
512void TextLayer::setLetterSpacing(Scalar letterSpacing) {
513 if (_letterSpacing != letterSpacing) {
514 _letterSpacing = letterSpacing;
515 setNeedsTextLayout();
516 }
517}
518
519Scalar TextLayer::getLetterSpacing() const {
520 return _letterSpacing;
521}
522
523void TextLayer::setNeedsTextLayout() {
524 if (_textLayout != nullptr) {
525 _textLayout = nullptr;
526 if (_attributedTextOnTapGestureRecognizer != nullptr) {
527 _attributedTextOnTapGestureRecognizer->setTextLayout(nullptr);
528 }
529 setNeedsLayout();
530 setNeedsDisplay();
531 }
532}
533
534static bool hasOnTapAttributeInTextLayout(const TextLayout& textLayout) {
535 for (const auto& attachment : textLayout.getAttachments()) {

Callers

nothing calls this directly

Calls 2

maxFunction · 0.85
fitsInMaxSizeMethod · 0.80

Tested by

no test coverage detected