292 bool p1_p2_equal = (orig->
x1 == orig->
x2 && orig->
y1 == orig->
y2);
293 bool p2_p3_equal = (orig->
x2 == orig->
x3 && orig->
y2 == orig->
y3);
294 bool p3_p4_equal = (orig->
x3 == orig->
x4 && orig->
y3 == orig->
y4);
320 if (np == 4 && b.
width() < .1*offset && b.
height() < .1*offset) {
322 (orig->
y1 - orig->
y2)*(orig->
y1 - orig->
y1) *
323 (orig->
x3 - orig->
x4)*(orig->
x3 - orig->
x4) +
324 (orig->
y3 - orig->
y4)*(orig->
y3 - orig->
y4);
326 (orig->
y1 - orig->
y2)*(orig->
y3 - orig->
y4);
327 if (dot < 0 && dot*dot < 0.8*l)
338 points_shifted[0] = points[0] + offset * prev_normal;
340 for (
int i = 1; i < np - 1; ++i) {
344 QPointF normal_sum = prev_normal + next_normal;
346 qreal r =
qreal(1.0) + prev_normal.x() * next_normal.x()
347 + prev_normal.y() * next_normal.y();
350 points_shifted[i] = points[i] + offset * prev_normal;
352 qreal k = offset / r;
353 points_shifted[i] = points[i] + k * normal_sum;
356 prev_normal = next_normal;
359 points_shifted[np - 1] = points[np - 1] + offset * prev_normal;
362 points_shifted[map[2]], points_shifted[map[3]]);
364 return good_offset(orig, shifted, offset, threshold);
The QPointF class defines a point in the plane using floating point precision.
QLineF unitVector() const
Returns the unit vector for this line, i.e a line starting at the same point as this line with a leng...
The QLineF class provides a two-dimensional vector using floating point precision.
static QBezier fromPoints(const QPointF &p1, const QPointF &p2, const QPointF &p3, const QPointF &p4)
The QRectF class defines a rectangle in the plane using floating point precision. ...
qreal height() const
Returns the height of the rectangle.
qreal width() const
Returns the width of the rectangle.
QPointF p2() const
Returns the line's end point.
static ShiftResult good_offset(const QBezier *b1, const QBezier *b2, qreal offset, qreal threshold)
QLineF normalVector() const
Returns a line that is perpendicular to this line with the same starting point and length...
static Q_DECL_CONSTEXPR bool qFuzzyIsNull(double d)
static qreal dot(const QPointF &a, const QPointF &b)