MCPcopy Create free account
hub / github.com/Tencent/libpag / CheckTextLaterTransform

Function CheckTextLaterTransform

exporter/src/export/ExportVerify.cpp:544–569  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

542}
543
544static void CheckTextLaterTransform(std::shared_ptr<PAGExportSession> session,
545 pag::TextLayer* layer) {
546 constexpr float largeScale = 5.0f;
547 constexpr float smallFontSize = 5.0f;
548
549 if (layer->transform == nullptr) {
550 return;
551 }
552 if (layer->transform->scale == nullptr || layer->transform->scale->animatable()) {
553 return;
554 }
555 auto& scale = layer->transform->scale->value;
556 auto minScale = std::min(scale.x, scale.y);
557 if (minScale < largeScale) {
558 return;
559 }
560 if (layer->sourceText == nullptr || layer->sourceText->animatable()) {
561 return;
562 }
563
564 auto fontSize = layer->getTextDocument()->fontSize;
565 if (fontSize <= smallFontSize) {
566 session->pushWarning(AlertInfoType::FontSmallAndScaleLarge,
567 std::to_string(static_cast<int>(minScale)));
568 }
569}
570
571static bool HasVerticalText(pag::Property<pag::TextDocumentHandle>* sourceText) {
572 if (sourceText == nullptr) {

Callers 1

CheckLayerPropertyFunction · 0.85

Calls 3

animatableMethod · 0.45
getTextDocumentMethod · 0.45
pushWarningMethod · 0.45

Tested by

no test coverage detected