MCPcopy Create free account
hub / github.com/callstack/agent-device / pointOffsetByDirection

Function pointOffsetByDirection

src/core/dispatch-interactions.ts:1025–1041  ·  view source on GitHub ↗
(
  x: number,
  y: number,
  direction: ScrollDirection,
  distance: number,
)

Source from the content-addressed store, hash-verified

1023}
1024
1025function pointOffsetByDirection(
1026 x: number,
1027 y: number,
1028 direction: ScrollDirection,
1029 distance: number,
1030): { x2: number; y2: number } {
1031 switch (direction) {
1032 case 'up':
1033 return { x2: x, y2: y - distance };
1034 case 'down':
1035 return { x2: x, y2: y + distance };
1036 case 'left':
1037 return { x2: x - distance, y2: y };
1038 case 'right':
1039 return { x2: x + distance, y2: y };
1040 }
1041}
1042
1043export async function handleReadCommand(
1044 device: DeviceInfo,

Callers 1

handleFlingCommandFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…