ISSUE-053 - Minor improvement to clipConvertToPercent().

This commit is contained in:
Kyle Geib committed 2022-03-15 14:16:18 -05:00
1 parent a11f5b8eb6
commit 47ae67a5a8
1 file changed
+1 -4
+1 -4
View File
@@ -24,10 +24,7 @@ export function placementStyleRules(pos: Placement) {
* @returns A function that can be used to convert pixel values into percent values * @returns A function that can be used to convert pixel values into percent values
*/ */
const clipConvertToPercent = (width: Px, height: Px) => const clipConvertToPercent = (width: Px, height: Px) =>
(coords: [Px, Px]): [Percent, Percent] => [ ([x, y]: [Px, Px]): [Percent, Percent] => [x / width * 100, y / height * 100];
coords[0] / width * 100,
coords[1] / height * 100,
];
/** /**
* Provides the x, y coordinates of a three point polygon for use in a clip-path * Provides the x, y coordinates of a three point polygon for use in a clip-path