ran prettier
This commit is contained in:
parent
a1a83775d6
commit
4bc21a95c5
5 changed files with 71 additions and 58 deletions
|
@ -1,27 +1,25 @@
|
|||
|
||||
export class MathUtils {
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @param p Position to check.
|
||||
* @param r Rectangle to check the overlap against.
|
||||
* @returns true is overlapping
|
||||
*/
|
||||
public static isOverlappingWithRectangle(
|
||||
p: { x: number, y: number},
|
||||
r: { x: number, y: number, width: number, height: number},
|
||||
p: { x: number; y: number },
|
||||
r: { x: number; y: number; width: number; height: number }
|
||||
): boolean {
|
||||
return (this.isBetween(p.x, r.x, r.x + r.width) && this.isBetween(p.y, r.y, r.y + r.height));
|
||||
return this.isBetween(p.x, r.x, r.x + r.width) && this.isBetween(p.y, r.y, r.y + r.height);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @param value Value to check
|
||||
* @param min inclusive min value
|
||||
* @param max inclusive max value
|
||||
* @returns true if value is in <min, max>
|
||||
*/
|
||||
public static isBetween(value: number, min: number, max: number): boolean {
|
||||
return (value >= min) && (value <= max);
|
||||
return value >= min && value <= max;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue