You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-10 09:22:25 +03:00
@@ -14,6 +14,8 @@ See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
import { clamp } from "lodash";
|
||||
|
||||
/**
|
||||
* This method linearly interpolates between two points (start, end). This is
|
||||
* most commonly used to find a point some fraction of the way along a line
|
||||
@@ -25,5 +27,6 @@ limitations under the License.
|
||||
* @returns
|
||||
*/
|
||||
export function lerp(start: number, end: number, amt: number) {
|
||||
amt = clamp(amt, 0, 1);
|
||||
return (1 - amt) * start + amt * end;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user