Skip to content

Commit

Permalink
[qtwebkit] Change adjusted positioning only to be used for scaling op…
Browse files Browse the repository at this point in the history
…erations.

In practice only PageViewportControllerClientQt uses adjusted positions.
Event handling in QtWebPageEventHandler uses normal position.
  • Loading branch information
Raine Makelainen committed Oct 3, 2013
1 parent 1dccfec commit 851908b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions qtwebkit/Source/WebKit2/UIProcess/API/qt/qquickwebpage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,14 +155,14 @@ QPointF QQuickWebPage::adjustedPosition() const
return QPointF(xPos, yPos);
}

QTransform QQuickWebPage::transformFromItem() const
QTransform QQuickWebPage::transformFromItem(bool adjusted) const
{
return transformToItem().inverted();
return transformToItem(adjusted).inverted();
}

QTransform QQuickWebPage::transformToItem() const
QTransform QQuickWebPage::transformToItem(bool adjusted) const
{
QPointF pos = adjustedPosition();
QPointF pos = adjusted ? adjustedPosition() : position();
qreal xPos = pos.x();
qreal yPos = pos.y();

Expand Down
4 changes: 2 additions & 2 deletions qtwebkit/Source/WebKit2/UIProcess/API/qt/qquickwebpage_p.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ class QWEBKIT_EXPORT QQuickWebPage : public QQuickItem {
qreal contentsScale() const;
QPointF adjustedPosition() const;

QTransform transformFromItem() const;
QTransform transformToItem() const;
QTransform transformFromItem(bool adjusted = false) const;
QTransform transformToItem(bool adjusted = false) const;

WebKit::QtWebPageEventHandler* eventHandler() const;

Expand Down
8 changes: 4 additions & 4 deletions qtwebkit/Source/WebKit2/UIProcess/API/qt/qquickwebview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1815,7 +1815,7 @@ bool QQuickWebView::loading() const
QPointF QQuickWebView::mapToWebContent(const QPointF& pointInViewCoordinates) const
{
Q_D(const QQuickWebView);
return d->pageView->transformFromItem().map(pointInViewCoordinates);
return d->pageView->transformFromItem(true).map(pointInViewCoordinates);
}

/*!
Expand All @@ -1825,7 +1825,7 @@ QPointF QQuickWebView::mapToWebContent(const QPointF& pointInViewCoordinates) co
QRectF QQuickWebView::mapRectToWebContent(const QRectF& rectInViewCoordinates) const
{
Q_D(const QQuickWebView);
return d->pageView->transformFromItem().mapRect(rectInViewCoordinates);
return d->pageView->transformFromItem(true).mapRect(rectInViewCoordinates);
}

/*!
Expand All @@ -1835,7 +1835,7 @@ QRectF QQuickWebView::mapRectToWebContent(const QRectF& rectInViewCoordinates) c
QPointF QQuickWebView::mapFromWebContent(const QPointF& pointInCSSCoordinates) const
{
Q_D(const QQuickWebView);
return d->pageView->transformToItem().map(pointInCSSCoordinates);
return d->pageView->transformToItem(true).map(pointInCSSCoordinates);
}

/*!
Expand All @@ -1844,7 +1844,7 @@ QPointF QQuickWebView::mapFromWebContent(const QPointF& pointInCSSCoordinates) c
QRectF QQuickWebView::mapRectFromWebContent(const QRectF& rectInCSSCoordinates) const
{
Q_D(const QQuickWebView);
return d->pageView->transformToItem().mapRect(rectInCSSCoordinates);
return d->pageView->transformToItem(true).mapRect(rectInCSSCoordinates);
}

/*!
Expand Down

0 comments on commit 851908b

Please sign in to comment.