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

List:       kde-commits
Subject:    branches/work/kde4/playground/artwork/cokoon/lib
From:       Sandro Giessl <sgiessl () gmail ! com>
Date:       2006-02-27 18:40:22
Message-ID: 1141065622.321919.24124.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 514252 by giessl:

paint layer inheritance...

 M  +26 -11    object.cpp  


--- branches/work/kde4/playground/artwork/cokoon/lib/object.cpp #514251:514252
@@ -269,22 +269,37 @@
     m_paintWidth = width;
     m_paintHeight = height;
 
-    QPair<QString, QString> l;
-    foreach (l, m_paintLayers) {
-        const Object *i;
-        if (l.first.isEmpty() )
-            i = this;
-        else
-            i = m_doc->obj(l.first );
+    // layer inheritance resolution...
+    bool done = false;
+    const Object *o = this;
+    while (!done && o != 0) {
 
-        if (i) {
-            const TileLayout *layout = i->layout(l.second );
-            if (layout) {
-                layout->paint(p,left,top,width,height,vars);
+        // paint layers set for object o. paint and exit the loop
+        if (o->m_paintLayersSet) {
+            QPair<QString, QString> l;
+            foreach (l, o->m_paintLayers) {
+                const Object *i;
+                if (l.first.isEmpty() )
+                    i = this;
+                else
+                    i = m_doc->obj(l.first );
+
+                if (i) {
+                    const TileLayout *layout = i->layout(l.second );
+                    if (layout) {
+                        layout->paint(p,left,top,width,height,vars);
+                    }
+                }
             }
+            done = true;
+            continue;
         }
+
+        // layers were not set, try inherited object...
+        o = o->m_inherit;
     }
 
+
     m_paintWidth.clear();
     m_paintHeight.clear();
 }
[prev in list] [next in list] [prev in thread] [next in thread] 

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