| 823 | } |
| 824 | |
| 825 | bool Selection::IsSelected(int64_t offset) const { |
| 826 | switch (_type) { |
| 827 | case SelectionType::Simple: |
| 828 | |
| 829 | case SelectionType::Box: |
| 830 | if (offset < _offset) |
| 831 | return false; |
| 832 | return (offset - _offset) % _bytesPerLine < _width && (offset - _offset) / _bytesPerLine < _height; |
| 833 | } |
| 834 | ATLASSERT(false); |
| 835 | return false; |
| 836 | } |
| 837 | |
| 838 | bool Selection::IsEmpty() const { |
| 839 | return _offset < 0 || _length == 0; |