MCPcopy Index your code
hub / github.com/react-grid-layout/react-grid-layout / fromWrapPosition

Function fromWrapPosition

src/extras/wrapCompactor.ts:48–53  ·  view source on GitHub ↗

* Convert a linear wrap position back to x,y coordinates.

(pos: number, cols: number)

Source from the content-addressed store, hash-verified

46 * Convert a linear wrap position back to x,y coordinates.
47 */
48function fromWrapPosition(pos: number, cols: number): { x: number; y: number } {
49 return {
50 x: pos % cols,
51 y: Math.floor(pos / cols)
52 };
53}
54
55/**
56 * Compact items in wrap order, filling gaps from left-to-right, top-to-bottom.

Callers 1

compactWrapFunction · 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…