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

List:       kde-commits
Subject:    playground/office/flake/lib
From:       Thomas Zander <zander () kde ! org>
Date:       2006-05-14 20:26:28
Message-ID: 1147638388.790237.5933.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 540859 by zander:

Fix possible case where the boundingbox was incorrect due to a group

 M  +8 -5      KoSelection.cpp  


--- trunk/playground/office/flake/lib/KoSelection.cpp #540858:540859
@@ -123,17 +123,20 @@
 
 QRectF KoSelection::boundingBox() const
 {
+    bool first=true;
     QRectF bb;
     if ( count() > 0 )
     {
         KoSelectionSet::const_iterator it = m_selectedObjects.begin();
-        bb = ( *it )->boundingBox();
-        ++it;
-        for ( ; it != m_selectedObjects.end(); ++it )
-        {
+        for ( ; it != m_selectedObjects.end(); ++it ) {
             if( dynamic_cast<KoShapeGroup*>( *it ))
                 continue;
-            bb = bb.unite( ( *it )->boundingBox() );
+            if(first) {
+                bb = (*it)->boundingBox();
+                first = false;
+            }
+            else
+                bb = bb.unite( ( *it )->boundingBox() );
         }
     }
     return bb;
[prev in list] [next in list] [prev in thread] [next in thread] 

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