(_ref5)
| 45616 | |
| 45617 | |
| 45618 | function getPickingRect(_ref5) { |
| 45619 | var deviceX = _ref5.deviceX, |
| 45620 | deviceY = _ref5.deviceY, |
| 45621 | deviceRadius = _ref5.deviceRadius, |
| 45622 | deviceWidth = _ref5.deviceWidth, |
| 45623 | deviceHeight = _ref5.deviceHeight; |
| 45624 | var valid = deviceX >= 0 && deviceY >= 0 && deviceX < deviceWidth && deviceY < deviceHeight; // x, y out of bounds. |
| 45625 | |
| 45626 | if (!valid) { |
| 45627 | return null; |
| 45628 | } // Create a box of size `radius * 2 + 1` centered at [deviceX, deviceY] |
| 45629 | |
| 45630 | |
| 45631 | var x = Math.max(0, deviceX - deviceRadius); |
| 45632 | var y = Math.max(0, deviceY - deviceRadius); |
| 45633 | var width = Math.min(deviceWidth, deviceX + deviceRadius) - x + 1; |
| 45634 | var height = Math.min(deviceHeight, deviceY + deviceRadius) - y + 1; |
| 45635 | return { |
| 45636 | x: x, |
| 45637 | y: y, |
| 45638 | width: width, |
| 45639 | height: height |
| 45640 | }; |
| 45641 | } // TODO - break this monster function into 3+ parts |
| 45642 | |
| 45643 | |
| 45644 | function processPickInfo(_ref6) { |
no test coverage detected