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

List:       kde-commits
Subject:    KDE/kdegames/kolf
From:       Stefan Majewsky <majewsky () gmx ! net>
Date:       2010-11-12 21:07:25
Message-ID: 20101112210725.94ADBAC8A8 () svn ! kde ! org
[Download RAW message or body]

SVN commit 1196236 by majewsky:

Fix Z ordering of slopes on struts by using the correct instead of the legacy algorithm.

 M  +1 -8      canvasitem.cpp  


--- trunk/KDE/kdegames/kolf/canvasitem.cpp #1196235:1196236
@@ -96,17 +96,10 @@
 		if (citem && citem->m_zBehavior == CanvasItem::IsStrut)
 		{
 			//special condition for slopes: they must lie inside the strut's area, not only touch it
-			//HACK: for compatibility reasons, the condition is that area of slope < area of strut
 			Kolf::Slope* slope = dynamic_cast<Kolf::Slope*>(this);
 			if (slope)
-			{
-				const QSizeF slopeSize = slope->size();
-				const qreal slopeArea = slopeSize.width() * slopeSize.height();
-				const QSizeF strutSize = qitem->boundingRect().size();
-				const qreal strutArea = strutSize.width() * strutSize.height();
-				if (slopeArea > strutArea)
+				if (!slope->collidesWithItem(qitem, Qt::ContainsItemBoundingRect))
 					continue;
-			}
 			//strut found
 			m_strut = citem;
 			m_strut->m_struttedItems << this;
[prev in list] [next in list] [prev in thread] [next in thread] 

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