Changeset 67687 in webkit


Ignore:
Timestamp:
Sep 16, 2010 6:32:42 PM (14 years ago)
Author:
tonikitoo@webkit.org
Message:

2010-09-12 Antonio Gomes <tonikitoo@webkit.org>

Reviewed by Andreas Kling.

Moved setYRotation method body out of the class (WebViewGraphicsBased) definition.

We usually separate methods whose body are larger the a few lines from the class definition.

  • QtTestBrowser/webview.h: (WebViewGraphicsBased::yRotation): (WebViewGraphicsBased::setYRotation):
Location:
trunk/WebKitTools
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebKitTools/ChangeLog

    r67686 r67687  
     12010-09-12  Antonio Gomes  <tonikitoo@webkit.org>
     2
     3        Reviewed by Andreas Kling.
     4
     5        Moved setYRotation method body out of the class (WebViewGraphicsBased) definition.
     6
     7        We usually separate methods whose body are larger than a few lines from the class definition.
     8
     9        * QtTestBrowser/webview.h:
     10        (WebViewGraphicsBased::yRotation):
     11        (WebViewGraphicsBased::setYRotation):
     12
    1132010-09-12  Antonio Gomes  <tonikitoo@webkit.org>
    214
  • trunk/WebKitTools/QtTestBrowser/webview.h

    r65159 r67687  
    8888    bool resizesToContents() const { return m_resizesToContents; }
    8989
    90     void setYRotation(qreal angle)
    91     {
    92 #if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
    93         QRectF r = m_item->boundingRect();
    94         m_item->setTransform(QTransform()
    95             .translate(r.width() / 2, r.height() / 2)
    96             .rotate(angle, Qt::YAxis)
    97             .translate(-r.width() / 2, -r.height() / 2));
    98 #endif
    99         m_yRotation = angle;
    100     }
    101     qreal yRotation() const
    102     {
    103         return m_yRotation;
    104     }
     90    void setYRotation(qreal angle);
     91    qreal yRotation() const { return m_yRotation; }
    10592
    10693    GraphicsWebView* graphicsWebView() const { return m_item; }
     
    129116};
    130117
     118inline void WebViewGraphicsBased::setYRotation(qreal angle)
     119{
     120#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
     121    QRectF r = graphicsWebView()->boundingRect();
     122    graphicsWebView()->setTransform(QTransform()
     123        .translate(r.width() / 2, r.height() / 2)
     124        .rotate(angle, Qt::YAxis)
     125        .translate(-r.width() / 2, -r.height() / 2));
    131126#endif
     127    m_yRotation = angle;
     128}
     129
     130#endif
Note: See TracChangeset for help on using the changeset viewer.