mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
Refactoring points
Signed-off-by: Mark Tolmacs <mark@lazycat.hu>
This commit is contained in:
parent
8ca4cf3260
commit
b4cb314090
40 changed files with 746 additions and 783 deletions
|
@ -71,8 +71,8 @@ export const rangeIntersection = (
|
|||
* Determine if a value is inside a range.
|
||||
*
|
||||
* @param value The value to check
|
||||
* @param range The range
|
||||
* @returns
|
||||
* @param range The range to check
|
||||
* @returns TRUE if the value is in range
|
||||
*/
|
||||
export const rangeIncludesValue = (
|
||||
value: number,
|
||||
|
@ -80,3 +80,13 @@ export const rangeIncludesValue = (
|
|||
): boolean => {
|
||||
return value >= min && value <= max;
|
||||
};
|
||||
|
||||
/**
|
||||
* Determine the distance between the start and end of the range.
|
||||
*
|
||||
* @param range The range of which to measure the extent of
|
||||
* @returns The scalar distance or extent of the start and end of the range
|
||||
*/
|
||||
export function rangeExtent([a, b]: InclusiveRange) {
|
||||
return Math.abs(a - b);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue