From ac29d0811ee1d712aefd2468374354de948bebfd Mon Sep 17 00:00:00 2001 From: Robin Burchell Date: Fri, 14 Apr 2017 10:39:54 +0200 Subject: examples: Remove some unnecessary (and non-ideal) use of internal API boundingRect is not documented for public use, and there's no need to repeatedly call it either. Change-Id: I844c704da0c0e7a5e94b387c5ebe9b26dc6b59fe Reviewed-by: Gunnar Sletta --- examples/quick/scenegraph/customgeometry/beziercurve.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'examples/quick/scenegraph') diff --git a/examples/quick/scenegraph/customgeometry/beziercurve.cpp b/examples/quick/scenegraph/customgeometry/beziercurve.cpp index ca3c6f524b..750ff6aa3b 100644 --- a/examples/quick/scenegraph/customgeometry/beziercurve.cpp +++ b/examples/quick/scenegraph/customgeometry/beziercurve.cpp @@ -152,7 +152,7 @@ QSGNode *BezierCurve::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *) //! [7] //! [8] - QRectF bounds = boundingRect(); + QSizeF itemSize = size(); QSGGeometry::Point2D *vertices = geometry->vertexDataAsPoint2D(); for (int i = 0; i < m_segmentCount; ++i) { qreal t = i / qreal(m_segmentCount - 1); @@ -163,8 +163,8 @@ QSGNode *BezierCurve::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *) + 3 * invt * t * t * m_p3 + t * t * t * m_p4; - float x = bounds.x() + pos.x() * bounds.width(); - float y = bounds.y() + pos.y() * bounds.height(); + float x = pos.x() * itemSize.width(); + float y = pos.y() * itemSize.height(); vertices[i].set(x, y); } -- cgit v1.2.3