summaryrefslogtreecommitdiffstats
path: root/demos
diff options
context:
space:
mode:
authorWarwick Allison <warwick.allison@nokia.com>2009-11-17 05:18:38 (GMT)
committerWarwick Allison <warwick.allison@nokia.com>2009-11-17 05:18:38 (GMT)
commit7c400a77dfbc3f45cb7626962b6e055d582f4cba (patch)
treea960efcada589b065ebf835d6223f5846a24f6dc /demos
parent5edfb015ac0d8193dc1f455e7a04f6c9c0b3b013 (diff)
downloadQt-7c400a77dfbc3f45cb7626962b6e055d582f4cba.zip
Qt-7c400a77dfbc3f45cb7626962b6e055d582f4cba.tar.gz
Qt-7c400a77dfbc3f45cb7626962b6e055d582f4cba.tar.bz2
Partial fix for QTBUGT-5845
Diffstat (limited to 'demos')
-rw-r--r--demos/declarative/webbrowser/webbrowser.qml15
1 files changed, 8 insertions, 7 deletions
diff --git a/demos/declarative/webbrowser/webbrowser.qml b/demos/declarative/webbrowser/webbrowser.qml
index 8a01af5..23e0a20 100644
--- a/demos/declarative/webbrowser/webbrowser.qml
+++ b/demos/declarative/webbrowser/webbrowser.qml
@@ -202,11 +202,11 @@ Item {
var sc = zoom/zoomFactor;
scaleAnim.to = sc;
flickVX.from = flickable.viewportX
- flickVX.to = Math.min(Math.max(0,centerX-flickable.width/2),webView.width*sc-flickable.width)
- finalX.value = Math.min(Math.max(0,centerX-flickable.width/2),webView.width*sc-flickable.width)
+ flickVX.to = Math.max(0,Math.min(centerX-flickable.width/2,webView.width*sc-flickable.width))
+ finalX.value = flickVX.to
flickVY.from = flickable.viewportY
- flickVY.to = Math.min(Math.max(0,centerY-flickable.height/2),webView.height*sc-flickable.height)
- finalY.value = Math.min(Math.max(0,centerY-flickable.height/2),webView.height*sc-flickable.height)
+ flickVY.to = Math.max(0,Math.min(centerY-flickable.height/2,webView.height*sc-flickable.height))
+ finalY.value = flickVY.to
finalZoom.value = zoom
quickZoom.start()
}
@@ -214,11 +214,12 @@ Item {
preferredWidth: flickable.width
preferredHeight: flickable.height
- zoomFactor: flickable.width > 980 ? flickable.width : flickable.width/980
+ zoomFactor: flickable.width > 980 ? 1 : flickable.width/980
onUrlChanged: { if (url != null) { webBrowser.urlString = url.toString(); } }
- onDoubleClick: { if (!heuristicZoom(clickX,clickY,2.5)) {
- var zf = flickable.width > 980 ? flickable.width : flickable.width/980;
+ onDoubleClick: {
+ if (!heuristicZoom(clickX,clickY,2.5)) {
+ var zf = flickable.width > 980 ? 1 : flickable.width/980;
doZoom(zf,clickX/zoomFactor*zf,clickY/zoomFactor*zf)
}
}