32 painter.setRenderHint(QPainter::Antialiasing,
false);
34 const QColor crossingColor(80,130,8);
35 const QColor coveringColor(8,60,167);
39 crossingColor : coveringColor);
41 selectColor.setAlphaF(0.8);
43 select.setCosmetic(
true);
44 painter.setPen(select);
46 selectColor.setAlphaF(0.4);
47 const QBrush fillBrush(selectColor);
48 painter.setBrush(fillBrush);
51 paintRect = paintRect.normalized();
53 painter.drawRect(paintRect);
59 QPointF point = d->snapGuide->snap(
p, modifiers);
60 if (modifiers & Qt::ControlModifier) {
61 const QRectF oldDirtyRect = d->selectedRect();
62 d->selectRect.moveTopLeft(d->selectRect.topLeft() - (d->lastPos - point));
64 d->tool->canvas()->updateCanvas(oldDirtyRect | d->selectedRect());
68 QPointF old = d->selectRect.bottomRight();
69 d->selectRect.setBottomRight(point);
81 x1.setY(d->selectRect.topLeft().y());
82 qreal h1 = point.y() - x1.y();
83 qreal h2 = old.y() - x1.y();
84 QRectF
A(x1, QSizeF(point.x() - x1.x(), point.y() < d->selectRect.top() ? qMin(h1, h2) : qMax(h1, h2)));
86 d->tool->canvas()->updateCanvas(
A);
89 x2.setX(d->selectRect.topLeft().x());
90 qreal w1 = point.x() - x2.x();
91 qreal w2 = old.x() - x2.x();
92 QRectF
B(x2, QSizeF(point.x() < d->selectRect.left() ? qMin(w1, w2) : qMax(w1, w2), point.y() - x2.y()));
94 d->tool->canvas()->updateCanvas(
B);