]> O.S.I.I.S - jp/crow.git/commitdiff
implement sizing check in UpdateLayout
authorjpbruyere <jp.bruyere@hotmail.com>
Fri, 25 Dec 2015 13:02:02 +0000 (14:02 +0100)
committerjpbruyere <jp.bruyere@hotmail.com>
Fri, 25 Dec 2015 13:02:02 +0000 (14:02 +0100)
src/GraphicObjects/GraphicObject.cs

index 5f919e64f0cb4e59b6d8a072049b25d0cba641be..fe707957fce05fd6333127bc2a9ce733621fe2f4 100644 (file)
@@ -500,12 +500,6 @@ namespace go
                                Interface.LayoutingQueue.RemoveAll (lq => lq.GraphicObject == this && (layoutType & (int)lq.LayoutType) > 0);\r
 \r
                                if ((layoutType & (int)LayoutingType.Width) > 0) {\r
-\r
-                                       //force sizing to fit if parent is sizing on children and \r
-                                       //this object has stretched size\r
-//                                     if (Parent.getBounds ().Width < 0 && Width == 0)\r
-//                                             Width = -1;\r
-                               \r
                                        if (Bounds.Width == 0) //stretch in parent\r
                                                Interface.LayoutingQueue.EnqueueAfterParentSizing (LayoutingType.Width, this);\r
                                        else if (Bounds.Width < 0) //fit \r
@@ -515,11 +509,6 @@ namespace go
                                }\r
 \r
                                if ((layoutType & (int)LayoutingType.Height) > 0) {\r
-\r
-                                       //force sizing to fit if parent is sizing on children\r
-//                                     if (Parent.getBounds ().Height < 0 && Height == 0)\r
-//                                             Height = -1;\r
-\r
                                        if (Bounds.Height == 0) //stretch in parent\r
                                                Interface.LayoutingQueue.EnqueueAfterParentSizing (LayoutingType.Height, this);\r
                                        else if (Bounds.Height < 0) //fit \r
@@ -647,6 +636,11 @@ namespace go
                                LastSlots.Y = Slot.Y;\r
                                break;\r
                        case LayoutingType.Width:\r
+                               //force sizing to fit if parent is sizing on children and\r
+                               //this object has stretched size\r
+                               if (Parent.getBounds ().Width < 0 && Width == 0)\r
+                                       Width = -1;\r
+\r
                                if (Width > 0)\r
                                        Slot.Width = Width;\r
                                else if (Width < 0)\r
@@ -670,6 +664,10 @@ namespace go
                                LastSlots.Width = Slot.Width;\r
                                break;\r
                        case LayoutingType.Height:\r
+                               //force sizing to fit if parent is sizing on children\r
+                               if (Parent.getBounds ().Height < 0 && Height == 0)\r
+                                       Height = -1;\r
+\r
                                if (Height > 0)\r
                                        Slot.Height = Height;\r
                                else if (Height < 0)\r