Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- bool fokin::MatrixShape::isOverlapped(const shape_ptr &addedShape, const shape_ptr &shape) const
- {
- if (shape == nullptr || addedShape == nullptr)
- {
- return false;
- }
- return (std::abs(shape->getFrameRect().pos.x - addedShape->getFrameRect().pos.x) < (shape->getFrameRect().width / 2 +
- addedShape->getFrameRect().width / 2) && std::abs(shape->getFrameRect().pos.y - addedShape->getFrameRect().pos.y) <
- (shape->getFrameRect().height / 2 + addedShape->getFrameRect().height / 2));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement