From 47ae67a5a8b4c4c9fee6622ecba32579e790addd Mon Sep 17 00:00:00 2001 From: Kyle Geib Date: Tue, 15 Mar 2022 14:16:18 -0500 Subject: [PATCH] ISSUE-053 - Minor improvement to clipConvertToPercent(). --- src/utils/styling.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/utils/styling.ts b/src/utils/styling.ts index bbcbcd8..d0a616b 100644 --- a/src/utils/styling.ts +++ b/src/utils/styling.ts @@ -24,10 +24,7 @@ export function placementStyleRules(pos: Placement) { * @returns A function that can be used to convert pixel values into percent values */ const clipConvertToPercent = (width: Px, height: Px) => - (coords: [Px, Px]): [Percent, Percent] => [ - coords[0] / width * 100, - coords[1] / height * 100, - ]; + ([x, y]: [Px, Px]): [Percent, Percent] => [x / width * 100, y / height * 100]; /** * Provides the x, y coordinates of a three point polygon for use in a clip-path