Commit 81df344c authored by Whitfield, Ross's avatar Whitfield, Ross
Browse files

Get working for Shape2DRectangle

parent dcdea5fe
......@@ -406,13 +406,19 @@ bool Shape2DRectangle::selectAt(const QPointF &p) const {
}
void Shape2DRectangle::drawShape(QPainter &painter) const {
QRectF drawRect = m_boundingRect.toQRectF();
auto center = m_boundingRect.center();
QRectF drawRect = m_boundingRect.translated(-center).toQRectF();
painter.save();
double rotation = 20;
painter.rotate(rotation);
painter.translate(QTransform().rotate(-rotation).map(center));
painter.drawRect(drawRect);
if (m_fill_color != QColor()) {
QPainterPath path;
path.addRect(drawRect);
painter.fillPath(path, m_fill_color);
}
painter.restore();
}
void Shape2DRectangle::addToPath(QPainterPath &path) const {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment