static QPoint lineEntryPos(const QPoint &p1, const QPoint &p2, const QRect &rect)
{
QPoint result;
-
switch (classifyLine(p1, p2)) {
case CETypes::UpDir:
result = QPoint(p1.x(), rect.bottom());
result = QPoint(rect.left(), p1.y());
break;
}
-
return result;
}
static QPolygonF arrowHead(const QPoint &p1, const QPoint &p2)
{
QPolygonF result;
-
+ result.reserve(3);
switch (classifyLine(p1, p2)) {
case CETypes::UpDir:
result.append(p2 + QPoint(0, 1));
result.append(p2 + QPoint(-2*LINE_PROXIMITY_RADIUS, LINE_PROXIMITY_RADIUS));
break;
}
-
return result;
}
p->drawRect(QRectF(x1, y1, x2-x1, y2-y1));
} else { // draw trapezoid
QPolygonF quad;
+ quad.reserve(4);
switch (edge) {
case TopEdge:
quad << QPointF(x1, y1) << QPointF(x1 + dw1, y2)
const QList<int> &subpath_list = isects[i];
if (!subpath_list.isEmpty()) {
QPolygonF buildUp;
+ buildUp.reserve(subpath_list.size());
for (int j=0; j<subpath_list.size(); ++j) {
const QPolygonF &subpath = subpaths.at(subpath_list.at(j));
buildUp += subpath;
if (flats.isEmpty())
return polygon;
QPointF first = flats.first().first();
+ polygon.reserve(flats.size());
for (int i=0; i<flats.size(); ++i) {
polygon += flats.at(i);
if (!flats.at(i).isClosed())