aboutsummaryrefslogtreecommitdiffstats
path: root/src/particles
diff options
context:
space:
mode:
authorGunnar Sletta <gunnar.sletta@digia.com>2013-04-23 12:32:01 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-04-23 12:53:48 +0200
commit28b6c39af1c3e919e83ddace18a5252c4423431b (patch)
tree637a9fef4f7f639dcb46d414257e8024d4164fc0 /src/particles
parentf711f9387544aabf21ec19a7dd1dcb91f3d947fc (diff)
Use the actual size of the image for the iteration.
If the rectangle dimension was a floating-point value, we could sample outside the image, causing tons of warnings. Change-Id: I10abece9a6b0cf769551f554fb5999d5d90e4c9d Reviewed-by: aavit <eirik.aavitsland@digia.com>
Diffstat (limited to 'src/particles')
-rw-r--r--src/particles/qquickmaskextruder.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/particles/qquickmaskextruder.cpp b/src/particles/qquickmaskextruder.cpp
index 3153e2b7d0..927cf97006 100644
--- a/src/particles/qquickmaskextruder.cpp
+++ b/src/particles/qquickmaskextruder.cpp
@@ -132,8 +132,10 @@ void QQuickMaskExtruder::ensureInitialized(const QRectF &r)
m_img = m_pix.image().createAlphaMask();
m_img = m_img.convertToFormat(QImage::Format_Mono);//Else LSB, but I think that's easier
m_img = m_img.scaled(r.size().toSize());//TODO: Do they need aspect ratio stuff? Or tiling?
- for (int i=0; i<r.width(); i++){
- for (int j=0; j<r.height(); j++){
+ int w = m_img.width();
+ int h = m_img.height();
+ for (int i=0; i<w; i++){
+ for (int j=0; j<h; j++){
if (m_img.pixelIndex(i,j))//Direct bit manipulation is presumably more efficient
m_mask << QPointF(i,j);
}