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

Function GetTextAnimatorPosition

exporter/src/export/data/TextProperty.cpp:314–333  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

312}
313
314static pag::Property<pag::Point>* GetTextAnimatorPosition(const AEGP_StreamRefH& streamHandle) {
315 auto position = GetProperty(streamHandle, AEStreamParser::PointParser);
316 if (!position->animatable() && position->value.x == 0.0f && position->value.y == 0.0f) {
317 delete position;
318 return nullptr;
319 }
320
321 if (position->animatable()) {
322 auto& keyframes = static_cast<pag::AnimatableProperty<pag::Point>*>(position)->keyframes;
323 for (auto& keyframe : keyframes) {
324 auto newKeyframe = new pag::SpatialPointKeyframe();
325 *static_cast<pag::Keyframe<pag::Point>*>(newKeyframe) = *keyframe;
326 newKeyframe->initialize();
327 delete keyframe;
328 keyframe = newKeyframe;
329 }
330 }
331
332 return position;
333}
334
335static pag::Property<pag::Point>* GetTextAnimatorScale(const AEGP_StreamRefH& streamHandle) {
336 auto scale = GetProperty(streamHandle, AEStreamParser::ScaleParser);

Callers 1

Calls 3

GetPropertyFunction · 0.85
animatableMethod · 0.45
initializeMethod · 0.45

Tested by

no test coverage detected