34 painter.setRenderHint(QPainter::Antialiasing,
false);
44 crossingColor : coveringColor);
46 selectColor.setAlphaF(0.8);
48 select.setCosmetic(
true);
49 painter.setPen(select);
51 selectColor.setAlphaF(0.4);
52 const QBrush fillBrush(selectColor);
53 painter.setBrush(fillBrush);
56 paintRect = paintRect.normalized();
58 painter.drawRect(paintRect);
64 QPointF point = d->snapGuide->snap(
p, modifiers);
65 if (modifiers & Qt::ControlModifier) {
66 const QRectF oldDirtyRect = d->selectedRect();
67 d->selectRect.moveTopLeft(d->selectRect.topLeft() - (d->lastPos - point));
69 d->tool->canvas()->updateCanvas(oldDirtyRect | d->selectedRect());
73 QPointF old = d->selectRect.bottomRight();
74 d->selectRect.setBottomRight(point);
86 x1.setY(d->selectRect.topLeft().y());
87 qreal h1 = point.y() - x1.y();
88 qreal h2 = old.y() - x1.y();
89 QRectF
A(x1, QSizeF(point.x() - x1.x(), point.y() < d->selectRect.top() ? qMin(h1, h2) : qMax(h1, h2)));
91 d->tool->canvas()->updateCanvas(
A);
94 x2.setX(d->selectRect.topLeft().x());
95 qreal w1 = point.x() - x2.x();
96 qreal w2 = old.x() - x2.x();
97 QRectF
B(x2, QSizeF(point.x() < d->selectRect.left() ? qMin(w1, w2) : qMax(w1, w2), point.y() - x2.y()));
99 d->tool->canvas()->updateCanvas(
B);