| 19 | namespace Shapes { |
| 20 | |
| 21 | Rectangle::Rectangle(QPointF pt1, QPointF pt2) |
| 22 | { |
| 23 | m_paths.resize(1); |
| 24 | handlers.reserve(PtCount); |
| 25 | |
| 26 | handlers.emplace_back(std::make_unique<Handler>(this, Handler::Center)); |
| 27 | handlers.emplace_back(std::make_unique<Handler>(this)); |
| 28 | handlers.emplace_back(std::make_unique<Handler>(this)); |
| 29 | handlers.emplace_back(std::make_unique<Handler>(this)); |
| 30 | handlers.emplace_back(std::make_unique<Handler>(this)); |
| 31 | |
| 32 | handlers[Point1]->setPos(pt1); |
| 33 | handlers[Point3]->setPos(pt2); |
| 34 | |
| 35 | redraw(); |
| 36 | |
| 37 | App::scene()->addItem(this); |
| 38 | } |
| 39 | |
| 40 | Rectangle::~Rectangle() { } |
| 41 | |