| 19 | } |
| 20 | |
| 21 | bool BoundingBoxHierarchy::contains(const Rect& box) { |
| 22 | if (_rTree == nullptr) { |
| 23 | SkRTreeFactory factory; |
| 24 | _rTree = factory(); |
| 25 | _rTree->insert(_frames.data(), static_cast<int>(_frames.size())); |
| 26 | } |
| 27 | |
| 28 | _rTree->search(box.getSkValue(), &_rTreeOutput); |
| 29 | if (_rTreeOutput.empty()) { |
| 30 | return false; |
| 31 | } else { |
| 32 | _rTreeOutput.clear(); |
| 33 | return true; |
| 34 | } |
| 35 | } |
| 36 | |
| 37 | } // namespace snap::drawing |