mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-04-20 03:06:59 +08:00
opt: image viewer (#1837)
* opt: image * opt: MatrixTransition * update --------- Co-authored-by: dom <githubaccount56556@proton.me>
This commit is contained in:
committed by
GitHub
parent
9c7c6f9e4e
commit
85292a3df2
@@ -21,4 +21,20 @@ extension DoubleExt on double {
|
||||
final mod = pow(10, fractionDigits).toDouble();
|
||||
return (this * mod).roundToDouble() / mod;
|
||||
}
|
||||
|
||||
bool equals(double other, [double epsilon = 1e-10]) =>
|
||||
(this - other).abs() < epsilon;
|
||||
|
||||
double lerp(double a, double b) {
|
||||
assert(
|
||||
a.isFinite,
|
||||
'Cannot interpolate between finite and non-finite values',
|
||||
);
|
||||
assert(
|
||||
b.isFinite,
|
||||
'Cannot interpolate between finite and non-finite values',
|
||||
);
|
||||
assert(isFinite, 't must be finite when interpolating between values');
|
||||
return a * (1.0 - this) + b * this;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user