forked from qt-creator/qt-creator
Fix of a spelling error in the Html5 template code
Change-Id: Id0b0186b66254e275cb1648e57055ab44530a64a Reviewed-by: Eike Ziller <eike.ziller@nokia.com> Reviewed-by: Alessandro Portale <alessandro.portale@nokia.com>
This commit is contained in:
@@ -34,7 +34,7 @@ bool WebTouchPhysics::inMotion()
|
|||||||
void WebTouchPhysics::stop()
|
void WebTouchPhysics::stop()
|
||||||
{
|
{
|
||||||
m_decelerationTimer.stop();
|
m_decelerationTimer.stop();
|
||||||
m_cumlativeDistance = QPoint();
|
m_cumulativeDistance = QPoint();
|
||||||
m_previousPoint = QPoint();
|
m_previousPoint = QPoint();
|
||||||
m_startPressPoint = QPoint();
|
m_startPressPoint = QPoint();
|
||||||
m_decelerationPoints.clear();
|
m_decelerationPoints.clear();
|
||||||
@@ -67,7 +67,7 @@ bool WebTouchPhysics::move(const QPointF &pressPoint)
|
|||||||
bool WebTouchPhysics::release(const QPointF &pressPoint)
|
bool WebTouchPhysics::release(const QPointF &pressPoint)
|
||||||
{
|
{
|
||||||
// use the cumulative distance in this case because it seems like a positive user experience
|
// use the cumulative distance in this case because it seems like a positive user experience
|
||||||
if (m_cumlativeDistance.manhattanLength() > KCumlativeDistanceThreshold) {
|
if (m_cumulativeDistance.manhattanLength() > KCumulativeDistanceThreshold) {
|
||||||
m_decelerationSpeed = (m_decelerationPoints.back() - pressPoint) / (m_decelerationPoints.count() + 1);
|
m_decelerationSpeed = (m_decelerationPoints.back() - pressPoint) / (m_decelerationPoints.count() + 1);
|
||||||
m_decelerationTimer.start();
|
m_decelerationTimer.start();
|
||||||
return true;
|
return true;
|
||||||
@@ -83,7 +83,7 @@ void WebTouchPhysics::changePosition(const QPointF &point)
|
|||||||
QPointF diff = m_previousPoint - point;
|
QPointF diff = m_previousPoint - point;
|
||||||
emit positionChanged(diff, m_startPressPoint);
|
emit positionChanged(diff, m_startPressPoint);
|
||||||
|
|
||||||
m_cumlativeDistance += (point - m_previousPoint);
|
m_cumulativeDistance += (point - m_previousPoint);
|
||||||
m_previousPoint = point;
|
m_previousPoint = point;
|
||||||
m_decelerationPoints.push_front(point);
|
m_decelerationPoints.push_front(point);
|
||||||
if (m_decelerationPoints.count() > KDecelerationCount)
|
if (m_decelerationPoints.count() > KDecelerationCount)
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
#include "webtouchphysicsinterface.h"
|
#include "webtouchphysicsinterface.h"
|
||||||
|
|
||||||
static const int KCumlativeDistanceThreshold = 40;
|
static const int KCumulativeDistanceThreshold = 40;
|
||||||
static const int KDecelerationCount = 4;
|
static const int KDecelerationCount = 4;
|
||||||
static const int KDecelerationTimerSpeed = 10;
|
static const int KDecelerationTimerSpeed = 10;
|
||||||
static const int KFlickScrollThreshold = 400;
|
static const int KFlickScrollThreshold = 400;
|
||||||
@@ -52,7 +52,7 @@ private:
|
|||||||
QPointF m_decelerationSpeed;
|
QPointF m_decelerationSpeed;
|
||||||
QList<QPointF> m_decelerationPoints;
|
QList<QPointF> m_decelerationPoints;
|
||||||
QTimer m_decelerationTimer;
|
QTimer m_decelerationTimer;
|
||||||
QPointF m_cumlativeDistance;
|
QPointF m_cumulativeDistance;
|
||||||
const QWebFrame* m_frame;
|
const QWebFrame* m_frame;
|
||||||
bool m_inMotion;
|
bool m_inMotion;
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user