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

Method refreshData

exporter/src/ui/exportPanel/settings/ExportTextLayerModel.cpp:41–69  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

39}
40
41void ExportTextLayerModel::refreshData(std::shared_ptr<AEResource> resource) {
42 if (resource->isExportAsBmp) {
43 return;
44 }
45 auto session = getSessionHandler(this->resource->ID);
46 for (const auto& layer : resource->composition.textLayers) {
47 if (session == nullptr ||
48 session->layerHandleMap.find(layer.layerID) == session->layerHandleMap.end()) {
49 continue;
50 }
51 auto iter = std::find_if(items.begin(), items.end(), [layer](const AEResource::Layer& item) {
52 return layer.layerID == item.layerID;
53 });
54 if (iter != items.end()) {
55 continue;
56 }
57 AEResource::Layer item = {layer.layerID, layer.name.data(), layer.layerHandle};
58 items.push_back(item);
59 if (this->resource->composition.textLayerFlagMap.find(layer.layerID) ==
60 this->resource->composition.textLayerFlagMap.end()) {
61 bool isEditable = GetLayerEditable(resource->itemHandle, layer.layerID);
62 this->resource->composition.textLayerFlagMap[layer.layerID] = {isEditable};
63 }
64 }
65
66 for (const auto& child : resource->composition.children) {
67 refreshData(child);
68 }
69}
70
71void ExportTextLayerModel::setIsEditable(int row, bool isEditable) {
72 if (row < 0 || static_cast<size_t>(row) >= items.size()) {

Callers

nothing calls this directly

Calls 4

GetLayerEditableFunction · 0.85
findMethod · 0.80
push_backMethod · 0.80
dataMethod · 0.45

Tested by

no test coverage detected