From kde-commits Mon Sep 01 16:49:36 2008 From: Dirk Mueller Date: Mon, 01 Sep 2008 16:49:36 +0000 To: kde-commits Subject: qt-copy/patches Message-Id: <1220287776.551397.4194.nullmailer () svn ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=122028778618806 SVN commit 855880 by mueller: updated patch M +9 -19 0247-avoid-wiggly-line-crashes.diff --- trunk/qt-copy/patches/0247-avoid-wiggly-line-crashes.diff #855879:855880 @@ -1,8 +1,8 @@ -qt-bugs@ issue : none yet +qt-bugs@ issue : N225275 Trolltech task ID : none yet bugs.kde.org number : ? applied: no -author: Dirk Mueller +author: from Trolltech The generateWavyPath function produces NaN arc's when the minWidth is negative. this apparently happens because textitems that do not @@ -10,22 +10,12 @@ --- src/gui/painting/qpainter.cpp +++ src/gui/painting/qpainter.cpp -@@ -5174,6 +5174,8 @@ static QPainterPath generateWavyPath(qre - extern int qt_defaultDpi(); - QPainterPath path; +@@ -5188,7 +5188,7 @@ static QPainterPath generateWavyPath(qre -+ Q_ASSERT(minWidth >= 0); -+ - bool up = true; - const qreal radius = 1.3 * device->logicalDpiY() / qt_defaultDpi(); - qreal xs, ys; -@@ -5423,7 +5425,8 @@ void QPainter::drawTextItem(const QPoint - } else { - d->engine->drawTextItem(p, ti); - } -- drawTextItemDecoration(this, p, ti); -+ if (ti.num_glyphs && ti.width.toReal() >= 0) -+ drawTextItemDecoration(this, p, ti); + // cut-off at the last arc segment + if (remaining < 2 * radius) +- angle = 180 * acos(1 - remaining / radius) / Q_PI; ++ angle = 180 * remaining / (2 * radius); - if (d->state->renderHints != oldRenderHints) { - d->state->renderHints = oldRenderHints; + path.arcTo(xs, ys, 2*radius, 2*radius, 180, up ? angle : -angle); +