From cc3f830c030e271f258bb330e5bc1fc400196389 Mon Sep 17 00:00:00 2001 From: Alan Alpert Date: Thu, 22 Sep 2011 13:42:21 +1000 Subject: [PATCH] Tighter bounding box check Because the gernic check works on floats and how .toPoint rounds, we need to redo the bounds checking inside Turbulence Task-number: QTBUG-21564 Change-Id: Ib56a8d420d9abf8035360b7908e89e28938799a8 Reviewed-on: http://codereview.qt-project.org/5343 Reviewed-by: Qt Sanity Bot Reviewed-by: Martin Jones --- src/declarative/particles/qsgturbulence.cpp | 11 +++++++++-- 1 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/declarative/particles/qsgturbulence.cpp b/src/declarative/particles/qsgturbulence.cpp index aa5dfeb..ac1306b 100644 --- a/src/declarative/particles/qsgturbulence.cpp +++ b/src/declarative/particles/qsgturbulence.cpp @@ -136,7 +136,9 @@ void QSGTurbulenceAffector::initializeGrid() for (int i=0; im_groupData){ if (!activeGroup(m_system->m_groupData.key(gd))) continue; @@ -187,6 +192,8 @@ void QSGTurbulenceAffector::affectSystem(qreal dt) if (!shouldAffect(d)) continue; QPoint pos = (QPointF(d->curX(), d->curY()) - m_offset).toPoint(); + if (!boundsRect.contains(pos,true))//Need to redo bounds checking due to quantization. + continue; qreal fx = 0.0; qreal fy = 0.0; fx += m_vectorField[pos.x()][pos.y()].x() * m_strength; -- 1.7.2.5