]> O.S.I.I.S - jp/crow.git/commitdiff
improve layouting debug output
authorjpbruyere <jp.bruyere@hotmail.com>
Tue, 16 Feb 2016 13:35:14 +0000 (14:35 +0100)
committerjpbruyere <jp.bruyere@hotmail.com>
Tue, 16 Feb 2016 13:44:47 +0000 (14:44 +0100)
src/GraphicObjects/GenericStack.cs
src/GraphicObjects/GraphicObject.cs
src/LayoutingQueueItem.cs

index 7f4dbea891f8afea4280fb53aa5c45bc8c17dd38..bbbc52ecc195596913bfac745456f451b04f073f 100644 (file)
@@ -83,9 +83,6 @@ namespace Crow
                }
                public virtual void ComputeChildrenPositions()
                {
-                       #if DEBUG_LAYOUTING
-                       Debug.WriteLine("ComputeChildrenPosition: " + this.ToString());
-                       #endif
                        int d = 0;
                        if (Orientation == Orientation.Horizontal) {
                                foreach (GraphicObject c in Children) {
@@ -149,6 +146,9 @@ namespace Crow
                                                if (stretchedGO.LastSlots.Width != tmpWidth) {
                                                        stretchedGO.Slot.Width = tmpWidth;
                                                        stretchedGO.bmp = null;
+                                                       #if DEBUG_LAYOUTING
+                                                       Debug.WriteLine ("\tAdjusting Width of " + stretchedGO.ToString());
+                                                       #endif
                                                        stretchedGO.OnLayoutChanges (LayoutingType.Width);
                                                        stretchedGO.LastSlots.Width = stretchedGO.Slot.Width;
                                                }
@@ -184,6 +184,9 @@ namespace Crow
                                                if (stretchedGO.LastSlots.Height != tmpHeight) {
                                                        stretchedGO.Slot.Height = tmpHeight;
                                                        stretchedGO.bmp = null;
+                                                       #if DEBUG_LAYOUTING
+                                                       Debug.WriteLine ("\tAdjusting Height of " + stretchedGO.ToString());
+                                                       #endif
                                                        stretchedGO.OnLayoutChanges (LayoutingType.Height);
                                                        stretchedGO.LastSlots.Height = stretchedGO.Slot.Height;
                                                }
index b184d2d9ea77349226bf3f6bc4501dfa6fe0b1d7..f10f2244839dd6a71ebcc05d08ba96333190a9be 100644 (file)
@@ -657,7 +657,7 @@ namespace Crow
                                return;
 
                        #if DEBUG_LAYOUTING
-                       Debug.WriteLine ("RegisterForLayouting => {1}->{0}", layoutType, this.ToString());
+                       Debug.WriteLine ("REGLayout => {1}->{0}", layoutType, this.ToString());
                        #endif
 
                        //enqueue LQI LayoutingTypes separately
@@ -677,7 +677,7 @@ namespace Crow
                public virtual void OnLayoutChanges(LayoutingType  layoutType)
                {
                        #if DEBUG_LAYOUTING
-                       Debug.WriteLine ("Layout change: " + this.ToString () + ":" + LastSlots.ToString() + "=>" + Slot.ToString ());
+                       Debug.WriteLine ("\t    " + LastSlots.ToString() + "\n\t => " + Slot.ToString ());
                        #endif
 
                        switch (layoutType) {
index 50dbe3915b87e8ef99799e274390773a1fc50462..ef56d6c6194bdaaad4045034ce30ac030cfe4318 100644 (file)
@@ -56,18 +56,20 @@ namespace Crow
                                Debug.WriteLine ("ERROR: processLayouting, no parent for: " + this.ToString ());
                                return;
                        }
+                       #if DEBUG_LAYOUTING
+                       Debug.WriteLine ("Layouting => " + this.ToString ());
+                       #endif
                        if (!GraphicObject.UpdateLayout (LayoutType)) {
                                #if DEBUG_LAYOUTING
-                               Debug.WriteLine ("Requeuing => " + this.ToString ());
+                               Debug.WriteLine ("\tRequeuing => " + this.ToString ());
                                #endif
                                GraphicObject.LayoutingTries ++;
-                               if (GraphicObject.LayoutingTries < Interface.MaxLayoutingTries)
+                               if (GraphicObject.LayoutingTries < Interface.MaxLayoutingTries) {
+                                       GraphicObject.RegisteredLayoutings |= LayoutType;
                                        Interface.LayoutingQueue.Enqueue (this);
+                               }
                        } else {
                                GraphicObject.LayoutingTries = 0;
-                               #if DEBUG_LAYOUTING
-                               Debug.WriteLine ("Layouting => " + this.ToString ());
-                               #endif
                        }
                }