| | |
| | | let screenY = e.clientY + scrollTop |
| | | let offsetT = screenY - 75 |
| | | let _width = parseInt(document.getElementById('darea').style.width) |
| | | let offsetL = screenX - (document.body.offsetWidth - _width - 30) / 2 |
| | | let offsetL = screenX - (document.body.offsetWidth - _width - 40) / 2 |
| | | |
| | | let cx = Math.floor(offsetL / _width * config.width) |
| | | let cy = Math.floor(offsetT / parseInt(document.getElementById('darea').style.height) * config.height) |
| | |
| | | height = _c |
| | | } |
| | | if (width === 0) { |
| | | x -= 4 |
| | | width = 8 |
| | | x -= 2 |
| | | width = 4 |
| | | } |
| | | if (height === 0) { |
| | | y -= 4 |
| | | height = 8 |
| | | y -= 2 |
| | | height = 4 |
| | | } |
| | | if (cx >= x && cx <= x + width && cy >= y && cy <= y + height) { |
| | | _selectItem = element |