Skip to content

Commit e6aa9d6

Browse files
committed
Internal lib - Remove unnecessary warning
1 parent 34b7fa3 commit e6aa9d6

File tree

2 files changed

+0
-19
lines changed

2 files changed

+0
-19
lines changed

src/lib.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -908,9 +908,6 @@ export function getCloserPoint(centerX, centerY, x, y, arcSize) {
908908

909909
export function getScaleFactorUsingArcSize(centerX, centerY, x, y, arcSize) {
910910
const euclidianDistance = Math.sqrt((x - centerX) ** 2 + (y - centerY) ** 2);
911-
if (arcSize >= euclidianDistance) {
912-
console.warn('arcSize must be less than the distance from the point to the center')
913-
}
914911
const scaleFactor = 1 - arcSize / euclidianDistance;
915912
return scaleFactor;
916913
}

tests/lib.test.js

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2042,22 +2042,6 @@ describe('getScaleFactorUsingArcSize', () => {
20422042
expect(scaleFactor).toBe(1);
20432043
});
20442044

2045-
test('should trigger a warning and return a scale factor of 0 when arcSize equals the distance', () => {
2046-
const scaleFactor = getScaleFactorUsingArcSize(100, 100, 110, 100, 10);
2047-
expect(console.warn).toHaveBeenCalledWith(
2048-
'arcSize must be less than the distance from the point to the center'
2049-
);
2050-
expect(scaleFactor).toBe(0);
2051-
});
2052-
2053-
test('should trigger a warning and return a negative scale factor when arcSize is greater than the distance', () => {
2054-
const scaleFactor = getScaleFactorUsingArcSize(100, 100, 110, 100, 20);
2055-
expect(console.warn).toHaveBeenCalledWith(
2056-
'arcSize must be less than the distance from the point to the center'
2057-
);
2058-
expect(scaleFactor).toBeLessThan(0);
2059-
});
2060-
20612045
test('should correctly calculate the scale factor for a diagonal point', () => {
20622046
const scaleFactor = getScaleFactorUsingArcSize(0, 0, 3, 4, 1);
20632047
expect(scaleFactor).toBeCloseTo(0.8, 1);

0 commit comments

Comments
 (0)