(position, zoom, origin)
| 102 | }; |
| 103 | |
| 104 | export const getZoomedPosition = (position, zoom, origin) => { |
| 105 | const [x, y] = position; |
| 106 | const [ox, oy] = origin; |
| 107 | const originedPosition = [x - ox, y - oy]; |
| 108 | |
| 109 | const zoomedPosition = originedPosition.map((axis) => axis * zoom); |
| 110 | |
| 111 | const [zx, zy] = zoomedPosition; |
| 112 | const movedPosition = [zx + ox, zy + oy]; |
| 113 | |
| 114 | return movedPosition; |
| 115 | }; |
| 116 | |
| 117 | export const getZoomedPositions = (positions, zoom, origin) => { |
| 118 | const zoomedPositions = positions.map((position) => |
no outgoing calls
no test coverage detected