mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
16 lines
425 B
C++
16 lines
425 B
C++
#include "Interpolatable.hpp"
|
|
|
|
namespace lottie {
|
|
|
|
double remapDouble(double value, double fromLow, double fromHigh, double toLow, double toHigh) {
|
|
return toLow + (value - fromLow) * (toHigh - toLow) / (fromHigh - fromLow);
|
|
}
|
|
|
|
double clampDouble(double value, double a, double b) {
|
|
double minValue = a <= b ? a : b;
|
|
double maxValue = a <= b ? b : a;
|
|
return std::max(std::min(value, maxValue), minValue);
|
|
}
|
|
|
|
}
|