MCPcopy Create free account
hub / github.com/TodePond/ScreenPond / isMappedPositionInCorners

Function isMappedPositionInCorners

source/position.js:88–96  ·  view source on GitHub ↗
(position, pity = [0, 0])

Source from the content-addressed store, hash-verified

86};
87
88export const isMappedPositionInCorners = (position, pity = [0, 0]) => {
89 const [x, y] = position;
90 const [px, py] = pity;
91 if (x <= 0.0 - px) return false;
92 if (x >= 1.0 + px) return false;
93 if (y <= 0.0 - py) return false;
94 if (y >= 1.0 + py) return false;
95 return true;
96};
97
98export const getScaledPosition = (position, corners) => {
99 const zeroedCorners = getZeroedCorners(corners);

Callers 2

tryToSurroundScreensFunction · 0.90
isPositionInCornersFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected