| 476 | setNeedsTextLayout(); |
| 477 | } |
| 478 | } |
| 479 | } |
| 480 | |
| 481 | double TextLayer::getMinimumScaleFactor() const { |
| 482 | return _minimumScaleFactor; |
| 483 | } |
| 484 | |
| 485 | void TextLayer::setLineHeight(Scalar lineHeight) { |
| 486 | if (_lineHeight != lineHeight) { |
| 487 | _lineHeight = lineHeight; |
| 488 | setNeedsTextLayout(); |
| 489 | } |
| 490 | } |
| 491 | |
| 492 | Scalar TextLayer::getLineHeight() const { |
| 493 | return _lineHeight; |
| 494 | } |
| 495 | |
| 496 | void TextLayer::setLineHeightAbsolute(Scalar lineHeightAbsolute) { |
| 497 | if (_usesLineHeightAbsolute != true || _lineHeightAbsolute != lineHeightAbsolute) { |
| 498 | _usesLineHeightAbsolute = true; |
| 499 | _lineHeightAbsolute = lineHeightAbsolute; |
| 500 | setNeedsTextLayout(); |
| 501 | } |
| 502 | } |
| 503 | |
| 504 | void TextLayer::resetLineHeightAbsolute() { |
| 505 | if (_usesLineHeightAbsolute) { |
| 506 | _usesLineHeightAbsolute = false; |
| 507 | _lineHeightAbsolute = 0.0f; |
| 508 | setNeedsTextLayout(); |
| 509 | } |
| 510 | } |
| 511 | |
| 512 | void TextLayer::setLetterSpacing(Scalar letterSpacing) { |
| 513 | if (_letterSpacing != letterSpacing) { |
| 514 | _letterSpacing = letterSpacing; |
| 515 | setNeedsTextLayout(); |
| 516 | } |
| 517 | } |
| 518 | |
| 519 | Scalar TextLayer::getLetterSpacing() const { |
| 520 | return _letterSpacing; |
| 521 | } |
| 522 | |
| 523 | void 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 | |
| 534 | static bool hasOnTapAttributeInTextLayout(const TextLayout& textLayout) { |
| 535 | for (const auto& attachment : textLayout.getAttachments()) { |
nothing calls this directly
no test coverage detected