aboutsummaryrefslogtreecommitdiffstats
path: root/examples/quick/scenegraph/customgeometry
diff options
context:
space:
mode:
authorRobin Burchell <robin.burchell@crimson.no>2017-04-14 10:39:54 +0200
committerRobin Burchell <robin.burchell@crimson.no>2017-04-21 13:28:41 +0000
commitac29d0811ee1d712aefd2468374354de948bebfd (patch)
tree5b77051df2eb2ace37b73741715761eab95e49c9 /examples/quick/scenegraph/customgeometry
parent0aaca005c0bb6267ddd14a84634c33c813e2d2c4 (diff)
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 <gunnar@crimson.no>
Diffstat (limited to 'examples/quick/scenegraph/customgeometry')
-rw-r--r--examples/quick/scenegraph/customgeometry/beziercurve.cpp6
1 files changed, 3 insertions, 3 deletions
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);
}