summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarko Niemelä <marko.a.niemela@nokia.com>2012-04-25 16:53:14 +0300
committerQt by Nokia <qt-info@nokia.com>2012-04-27 12:52:30 +0200
commit6c06561beaa21d2f1b6d062b2a2181e1f1c666f2 (patch)
tree733cc1d6f42459c69fd18dc21e0f87d31be893e6
parent3a4730282c959afff82dc63e2173831d7f21b5d7 (diff)
downloadqtgraphicaleffects-6c06561beaa21d2f1b6d062b2a2181e1f1c666f2.tar.gz
qtgraphicaleffects-6c06561beaa21d2f1b6d062b2a2181e1f1c666f2.tar.bz2
qtgraphicaleffects-6c06561beaa21d2f1b6d062b2a2181e1f1c666f2.zip
Avoid potential division by zero in DirectionalBlur.
Change-Id: I5582aa85cc834976004fa730a9902b9d3758575d Reviewed-by: Kim Gronholm <kim.1.gronholm@nokia.com>
-rw-r--r--src/effects/DirectionalBlur.qml2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/effects/DirectionalBlur.qml b/src/effects/DirectionalBlur.qml
index 63e1c0a..a9a924c 100644
--- a/src/effects/DirectionalBlur.qml
+++ b/src/effects/DirectionalBlur.qml
@@ -72,7 +72,7 @@ Item {
property real len: rootItem.length
property bool transparentBorder: rootItem.transparentBorder
property real samples: rootItem.samples
- property real weight: 1 / rootItem.samples
+ property real weight: 1.0 / Math.max(1.0, rootItem.samples)
property variant expandPixels: transparentBorder ? Qt.size(rootItem.samples, rootItem.samples) : Qt.size(0,0)
property variant expand: transparentBorder ? Qt.size(expandPixels.width / width, expandPixels.height / height) : Qt.size(0,0)
property variant delta: Qt.size(1.0 / rootItem.width * Math.cos((rootItem.angle + 90) * Math.PI/180), 1.0 / rootItem.height * Math.sin((rootItem.angle + 90) * Math.PI/180))