Commit 7adb00a0 authored by Gigg, Martyn Anthony's avatar Gigg, Martyn Anthony
Browse files

Set the pen width for drawing mask shapes

The default pen width changed from 0->1 in Qt5 so without
explicitly specifying the width the shapes come out very large.
parent 36e3fadb
......@@ -46,11 +46,10 @@ Shape2D::Shape2D()
void Shape2D::draw(QPainter &painter) const {
if (!m_visible)
return;
painter.setPen(m_color);
painter.setPen(QPen(m_color, 0));
this->drawShape(painter);
if (m_editing || m_selected) {
QColor c(255, 255, 255, 100);
painter.setPen(c);
painter.setPen(QPen(QColor(255, 255, 255, 100), 0));
painter.drawRect(m_boundingRect.toQRectF());
size_t np = NCommonCP;
double rsize = 2;
......@@ -66,10 +65,9 @@ void Shape2D::draw(QPainter &painter) const {
QRectF r(p - QPointF(rsize, rsize), p + QPointF(rsize, rsize));
painter.save();
painter.resetTransform();
QColor c(255, 255, 255, alpha);
painter.fillRect(r, c);
painter.fillRect(r, QColor(255, 255, 255, alpha));
r.adjust(-1, -1, 0, 0);
painter.setPen(QColor(0, 0, 0, alpha));
painter.setPen(QPen(QColor(0, 0, 0, alpha), 0));
painter.drawRect(r);
painter.restore();
}
......
Markdown is supported
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