From: jpbruyere Date: Sat, 6 Feb 2016 08:05:13 +0000 (+0100) Subject: prevent child positionning in a stack X-Git-Tag: 0.3~42^2~10 X-Git-Url: https://git.osiis.dedyn.io/?a=commitdiff_plain;h=4aad1e6e4fdb1059cbd43700c207b363f325f0e8;p=jp%2Fcrow.git prevent child positionning in a stack --- diff --git a/src/GraphicObjects/GraphicObject.cs b/src/GraphicObjects/GraphicObject.cs index 7927ccbe..e2ddf126 100644 --- a/src/GraphicObjects/GraphicObject.cs +++ b/src/GraphicObjects/GraphicObject.cs @@ -512,6 +512,19 @@ namespace Crow public LayoutingType RegisteredLayoutings = 0; public virtual void RegisterForLayouting(LayoutingType layoutType){ + //Prevent child repositionning in a stack + //TODO:this should be done inside GenericStack + GenericStack gs = Parent as GenericStack; + if (gs != null) { + if (gs.Orientation == Orientation.Horizontal) + layoutType &= (~LayoutingType.X); + else + layoutType &= (~LayoutingType.Y); + + if (layoutType == LayoutingType.None) + return; + } + if (RegisteredLayoutings == LayoutingType.None) Interface.RegisteredGOForLayouting.Enqueue (this); RegisteredLayoutings |= (LayoutingType)layoutType;