[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [amarok] src/widgets: Fix shadow rendering in On-Screen-Display.
From:       Mark Kretschmann <kretschmann () kde ! org>
Date:       2013-03-02 22:17:40
Message-ID: 20130302221740.A64BEA604F () git ! kde ! org
[Download RAW message or body]

Git commit 93d422211ac1a5e218db21936163c6eba0cc7a02 by Mark Kretschmann.
Committed on 02/03/2013 at 23:01.
Pushed by markey into branch 'master'.

Fix shadow rendering in On-Screen-Display.

The shadow was sometimes rendered in the wrong place. This happened
due to word wrap, which got triggered because the shadow text is a bit larger
than the regular text.

CCBUG: 257643

M  +3    -3    src/widgets/Osd.cpp

http://commits.kde.org/amarok/93d422211ac1a5e218db21936163c6eba0cc7a02

diff --git a/src/widgets/Osd.cpp b/src/widgets/Osd.cpp
index 0bae98b..6fb9538 100644
--- a/src/widgets/Osd.cpp
+++ b/src/widgets/Osd.cpp
@@ -223,7 +223,7 @@ OSDWidget::determineMetrics( const int M )
 
     // The osd cannot be larger than the screen
     QRect rect = fontMetrics().boundingRect( 0, 0, max.width() - image.width(), \
                max.height(),
-            Qt::AlignCenter | Qt::TextWordWrap, m_text );
+        Qt::AlignCenter, m_text );
     rect.adjust( 0, 0, SHADOW_SIZE * 2, SHADOW_SIZE * 2 ); // the shadow needs some \
space  
     if( m_showVolume )
@@ -233,7 +233,7 @@ OSDWidget::determineMetrics( const int M )
 
         QRect tmpRect = fontMetrics().boundingRect( 0, 0,
             max.width() - image.width(), max.height() - fontMetrics().height(),
-            Qt::AlignCenter | Qt::TextWordWrap, tmp );
+            Qt::AlignCenter, tmp );
         tmpRect.setHeight( tmpRect.height() + fontMetrics().height() / 2 );
 
         rect = tmpRect;
@@ -329,7 +329,7 @@ OSDWidget::paintEvent( QPaintEvent *e )
         shadowColor = v > 128 ? Qt::black : Qt::white;
     }
 
-    int align = Qt::AlignCenter | Qt::TextWordWrap;
+    const int align = Qt::AlignCenter;
 
     QPainter p( this );
     p.setRenderHints( QPainter::Antialiasing | QPainter::TextAntialiasing | \
QPainter::SmoothPixmapTransform | QPainter::HighQualityAntialiasing );


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic