Advertisement
Neveles

© 2020 Neveles. All rights reserved.

May 30th, 2020
179
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.48 KB | None | 0 0
  1. bool fokin::MatrixShape::isOverlapped(const shape_ptr &addedShape, const shape_ptr &shape) const
  2. {
  3.   if (shape == nullptr || addedShape == nullptr)
  4.   {
  5.     return false;
  6.   }
  7.   return (std::abs(shape->getFrameRect().pos.x - addedShape->getFrameRect().pos.x) < (shape->getFrameRect().width / 2 +
  8.     addedShape->getFrameRect().width / 2) && std::abs(shape->getFrameRect().pos.y - addedShape->getFrameRect().pos.y) <
  9.     (shape->getFrameRect().height / 2 + addedShape->getFrameRect().height / 2));
  10. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement