Details
-
Bug
-
Resolution: Invalid
-
Not Evaluated
-
None
-
4.6.3
-
None
Description
When text is rotated, the layout seems to be updated to snap to grid, which gives "jumping" text while the text is rotating. The effect is quite ugly for animation.
The problem can clearly be seen on the webpage http://webkit.org/blog-files/pulse.html
With Chrome or Safari, the text is ok during the animation. With Qt, each characters seems to jump around during the transformation. (The original bug report for WebKit is https://bugs.webkit.org/show_bug.cgi?id=32404 ).
Here is a reduction without showing the problem outside WebKit:
#include <QtGui> class Widget : public QWidget { public: Widget() : m_rotationAngle(0) { startTimer(16); } protected: void paintEvent(QPaintEvent *) { QPainter painter(this); painter.translate(200.f, 150.f); painter.rotate(m_rotationAngle); QFont textFont("Times"); textFont.setPixelSize(16); painter.setFont(textFont); painter.drawText(QPointF(-50, 0), QString("Some text is there YEEAAAAh")); } void timerEvent(QTimerEvent *) { m_rotationAngle += 0.5f; update(); } private: qreal m_rotationAngle; }; int main(int argc, char *argv[]) { QApplication app(argc, argv); Widget widget; widget.show(); return app.exec(); }