Refactoring

This commit is contained in:
Isaac 2024-05-20 15:37:06 +04:00
parent 1f1509a64c
commit 9c08df83a1
3 changed files with 3 additions and 16 deletions

View File

@ -622,7 +622,7 @@ CGRect getPathNativeBoundingBox(CGPathRef _Nonnull path) {
CGPoint scale = CGPointMake(size.width / (CGFloat)animation.size.width, size.height / (CGFloat)animation.size.height);
context->concatenate(lottie::Transform2D::makeScale(scale.x, scale.y));
renderLottieRenderNode(renderNode, context, lottie::Vector2D(context->width(), context->height()), rootTransform, 1.0, false, *_bezierPathsBoundingBoxContext.get());
//renderLottieRenderNode(renderNode, context, lottie::Vector2D(context->width(), context->height()), rootTransform, 1.0, false, *_bezierPathsBoundingBoxContext.get());
return nil;
}

View File

@ -176,7 +176,7 @@ public final class ViewController: UIViewController {
let updatesPerSecond = Double(numUpdates) / deltaTime
startTime = timestamp
numUpdates = 0
print("updatesPerSecond: \(updatesPerSecond)")
print("Ours: updatesPerSecond: \(updatesPerSecond)")
}
}
}.start()
@ -205,7 +205,7 @@ public final class ViewController: UIViewController {
let updatesPerSecond = Double(numUpdates) / deltaTime
startTime = timestamp
numUpdates = 0
print("updatesPerSecond: \(updatesPerSecond)")
print("Rlottie: updatesPerSecond: \(updatesPerSecond)")
}
}
}.start()

View File

@ -69,19 +69,6 @@ public:
return std::make_shared<CompoundBezierPath>();
}
/*bool trimSimultaneously = false;
if (trimSimultaneously) {
/// Trim each path individually.
std::vector<BezierPath> newPaths;
for (auto &path : paths) {
auto trimmedPaths = path.trim(fromPosition * path.length(), toPosition * path.length(), offset * path.length());
for (const auto &trimmedPath : trimmedPaths) {
newPaths.push_back(trimmedPath);
}
}
return std::make_shared<CompoundBezierPath>(newPaths);
}*/
float lengthValue = length();
/// Normalize lengths to the curve length.