From 6bd67cf30b1574a114d9852820fe0fb8d3d10c50 Mon Sep 17 00:00:00 2001 From: Alan Alpert Date: Mon, 31 May 2010 20:04:44 +0200 Subject: Fix zoom bug in QML Web Browser demo Zooming out no longer zooms to smaller than the window size. --- demos/declarative/webbrowser/content/FlickableWebView.qml | 4 ++-- demos/declarative/webbrowser/webbrowser.qml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/demos/declarative/webbrowser/content/FlickableWebView.qml b/demos/declarative/webbrowser/content/FlickableWebView.qml index 34e8fff..3a1b515 100644 --- a/demos/declarative/webbrowser/content/FlickableWebView.qml +++ b/demos/declarative/webbrowser/content/FlickableWebView.qml @@ -96,8 +96,8 @@ Flickable { function doZoom(zoom,centerX,centerY) { if (centerX) { - var sc = zoom/contentsScale; - scaleAnim.to = zoom; + var sc = zoom*contentsScale; + scaleAnim.to = sc; flickVX.from = flickable.contentX flickVX.to = Math.max(0,Math.min(centerX-flickable.width/2,webView.width*sc-flickable.width)) finalX.value = flickVX.to diff --git a/demos/declarative/webbrowser/webbrowser.qml b/demos/declarative/webbrowser/webbrowser.qml index 36e03bf..a923c92 100644 --- a/demos/declarative/webbrowser/webbrowser.qml +++ b/demos/declarative/webbrowser/webbrowser.qml @@ -47,7 +47,7 @@ import "content" Rectangle { id: webBrowser - property string urlString : "http://qt.nokia.com/" + property string urlString : "http://www.nokia.com/" width: 800; height: 600 color: "#343434" -- cgit v0.12