diff options
author | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com> | 2009-12-09 13:23:02 (GMT) |
---|---|---|
committer | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com> | 2010-01-14 13:07:11 (GMT) |
commit | eb674a7ff5fad2f4a76e3b20873c574eb8a6135f (patch) | |
tree | 958d115a90d12410aec322fcb5a55d2cebeb08ba /src/gui/painting/qpainter.cpp | |
parent | a9e08c091c822e65ae8453581c6fee4b94001682 (diff) | |
download | Qt-eb674a7ff5fad2f4a76e3b20873c574eb8a6135f.zip Qt-eb674a7ff5fad2f4a76e3b20873c574eb8a6135f.tar.gz Qt-eb674a7ff5fad2f4a76e3b20873c574eb8a6135f.tar.bz2 |
Optimize drawStaticText() with rectangle destination
In order to be feature consistent with drawText(), we have to clip the
text whenever the text expands beyond its borders. This is a
performance hit, but luckily we can detect the cases where it's
necessary before-hand.
Diffstat (limited to 'src/gui/painting/qpainter.cpp')
-rw-r--r-- | src/gui/painting/qpainter.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gui/painting/qpainter.cpp b/src/gui/painting/qpainter.cpp index 524f243..114492d 100644 --- a/src/gui/painting/qpainter.cpp +++ b/src/gui/painting/qpainter.cpp @@ -5773,7 +5773,7 @@ void QPainter::drawStaticText(const QPointF &position, const QStaticText &static } bool restoreWhenFinished = false; - if (staticText_d->size.isValid()) { + if (staticText_d->needsClipRect) { save(); setClipRect(QRectF(position, staticText_d->size)); |