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

Function ExportTextLayerEditable

exporter/src/export/Marker.cpp:723–750  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

721}
722
723void ExportTextLayerEditable(std::shared_ptr<pag::File> file,
724 std::shared_ptr<PAGExportSession> session,
725 const AEGP_ItemH& mainCompositionItemHandle) {
726 if (!file || file->numTexts() == 0) {
727 return;
728 }
729
730 auto textCount = file->numTexts();
731 std::vector<bool> isEditable(textCount, true);
732 bool hasNonEditableText = false;
733
734 for (int i = 0; i < textCount; ++i) {
735 auto layer = file->getTextAt(i);
736 if (IsTextLayerNonReplaceable(layer, mainCompositionItemHandle, session)) {
737 isEditable[i] = false;
738 hasNonEditableText = true;
739 }
740 }
741
742 if (hasNonEditableText) {
743 file->editableTexts = new std::vector<int>();
744 for (int i = 0; i < textCount; ++i) {
745 if (isEditable[i]) {
746 file->editableTexts->push_back(i);
747 }
748 }
749 }
750}
751
752void ExportLayerEditable(std::shared_ptr<pag::File> file, std::shared_ptr<PAGExportSession> session,
753 const AEGP_ItemH& itemHandle) {

Callers 1

ExportLayerEditableFunction · 0.85

Calls 4

getTextAtMethod · 0.80
push_backMethod · 0.80
numTextsMethod · 0.45

Tested by

no test coverage detected