Mark local helpers as static
diff --git a/src/shapes/metrics_path.cpp b/src/shapes/metrics_path.cpp
index 3574eef..29ae280 100644
--- a/src/shapes/metrics_path.cpp
+++ b/src/shapes/metrics_path.cpp
@@ -1,16 +1,15 @@
#include "rive/shapes/metrics_path.hpp"
#include "rive/renderer.hpp"
-#include <math.h>
using namespace rive;
-float clamp(float v, float lo, float hi) {
- if (v < lo) {
- return lo;
- } else if (v > hi) {
- return hi;
- }
- return v;
+static float clamp(float v, float lo, float hi) {
+ return std::min(std::max(v, lo), hi);
+}
+
+// Less exact, but faster, than std::lerp
+static float lerp(float from, float to, float f) {
+ return from + f * (to - from);
}
void MetricsPath::reset() {
@@ -244,8 +243,6 @@
}
}
-float lerp(float from, float to, float f) { return from + f * (to - from); }
-
void MetricsPath::extractSubPart(
int index, float startT, float endT, bool moveTo, RenderPath* result) {
assert(startT >= 0.0f && startT <= 1.0f && endT >= 0.0f && endT <= 1.0f);