| 190 | } |
| 191 | |
| 192 | static void CheckTextDirection(pag::Property<pag::TextDocumentHandle>* textDocument, |
| 193 | uint16_t tagLevel) { |
| 194 | if (textDocument == nullptr) { |
| 195 | return; |
| 196 | } |
| 197 | bool hasVerticalText = false; |
| 198 | if (textDocument->animatable()) { |
| 199 | for (const auto& keyFrame : |
| 200 | reinterpret_cast<pag::AnimatableProperty<pag::TextDocumentHandle>*>(textDocument) |
| 201 | ->keyframes) { |
| 202 | if (keyFrame->startValue->direction == pag::TextDirection::Vertical || |
| 203 | keyFrame->endValue->direction == pag::TextDirection::Vertical) { |
| 204 | hasVerticalText = true; |
| 205 | break; |
| 206 | } |
| 207 | } |
| 208 | if (!hasVerticalText || tagLevel < static_cast<uint16_t>(pag::TagCode::TextSourceV3)) { |
| 209 | for (auto& keyframe : |
| 210 | reinterpret_cast<pag::AnimatableProperty<pag::TextDocumentHandle>*>(textDocument) |
| 211 | ->keyframes) { |
| 212 | keyframe->startValue->direction = pag::TextDirection::Default; |
| 213 | keyframe->endValue->direction = pag::TextDirection::Default; |
| 214 | } |
| 215 | } |
| 216 | } else { |
| 217 | auto document = textDocument->getValueAt(0); |
| 218 | if (document->direction == pag::TextDirection::Vertical) { |
| 219 | hasVerticalText = true; |
| 220 | } |
| 221 | if (!hasVerticalText || tagLevel < static_cast<uint16_t>(pag::TagCode::TextSourceV3)) { |
| 222 | document->direction = pag::TextDirection::Default; |
| 223 | } |
| 224 | } |
| 225 | |
| 226 | if (hasVerticalText && tagLevel < static_cast<uint16_t>(pag::TagCode::TextSourceV3)) { |
| 227 | PAGExportSessionManager::GetInstance()->recordWarning(AlertInfoType::TagLevelVerticalText); |
| 228 | } |
| 229 | } |
| 230 | |
| 231 | static std::vector<pag::TextSelector*> GetTextSelectors(const AEGP_StreamRefH& streamHandle) { |
| 232 | const auto& Suites = GetSuites(); |
no test coverage detected