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

Function resolveFontScale

snap_drawing/src/snap_drawing/cpp/Layers/TextLayer.cpp:546–554  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

544static bool textLayoutHasStaleInlineAttachmentSizes(const TextLayout& textLayout, Scalar displayScale) {
545 for (const auto& attachment : textLayout.getAttachments()) {
546 auto inlineViewAttachment = Valdi::castOrNull<Valdi::TextInlineAttachment>(attachment.attachment);
547 if (inlineViewAttachment == nullptr) {
548 continue;
549 }
550
551 auto currentSize = inlineViewAttachment->getSize();
552 auto currentReplacementSize = Size::make(currentSize.width * displayScale, currentSize.height * displayScale);
553 if (attachment.replacementSize != currentReplacementSize) {
554 return true;
555 }
556 }
557

Callers 1

Calls 1

respectDynamicTypeMethod · 0.80

Tested by

no test coverage detected