From 4aad1e6e4fdb1059cbd43700c207b363f325f0e8 Mon Sep 17 00:00:00 2001 From: jpbruyere Date: Sat, 6 Feb 2016 09:05:13 +0100 Subject: [PATCH] prevent child positionning in a stack --- src/GraphicObjects/GraphicObject.cs | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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; -- 2.47.3