diff options
| author | jpbruyere <jp.bruyere@hotmail.com> | 2016-08-02 02:09:03 +0200 |
|---|---|---|
| committer | jpbruyere <jp.bruyere@hotmail.com> | 2016-08-02 02:09:03 +0200 |
| commit | 7da9c43d438eb88e13ddb6556660f8fd80d6be8e (patch) | |
| tree | a0781ccbc46d64ecad4f2229e8379b51eec54689 /src/GraphicObjects/GraphicObject.cs | |
| parent | 7aa1b2660fa257e570fb75f4c03bb33f1d7d151e (diff) | |
test stacking orientation for contentSize of stack adjustments
Diffstat (limited to 'src/GraphicObjects/GraphicObject.cs')
| -rw-r--r-- | src/GraphicObjects/GraphicObject.cs | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/src/GraphicObjects/GraphicObject.cs b/src/GraphicObjects/GraphicObject.cs index 7a2e8ec5..865e664c 100644 --- a/src/GraphicObjects/GraphicObject.cs +++ b/src/GraphicObjects/GraphicObject.cs @@ -251,10 +251,12 @@ namespace Crow //we should adapt contentSize //TODO:check case when child become stretched, and another stretched item already exists. if (_parent is GenericStack) {//TODO:check if I should test Group instead - if (lastWP == Measure.Fit) - (_parent as GenericStack).contentSize.Width -= this.LastSlots.Width; - else - (_parent as GenericStack).contentSize.Width += this.LastSlots.Width; + if ((_parent as GenericStack).Orientation == Orientation.Horizontal) { + if (lastWP == Measure.Fit) + (_parent as GenericStack).contentSize.Width -= this.LastSlots.Width; + else + (_parent as GenericStack).contentSize.Width += this.LastSlots.Width; + } } } @@ -277,10 +279,12 @@ namespace Crow if (HeightPolicy != lastHP) { NotifyValueChanged ("HeightPolicy", HeightPolicy); if (_parent is GenericStack) { - if (lastHP == Measure.Fit) - (_parent as GenericStack).contentSize.Height -= this.LastSlots.Height; - else - (_parent as GenericStack).contentSize.Height += this.LastSlots.Height; + if ((_parent as GenericStack).Orientation == Orientation.Vertical) { + if (lastHP == Measure.Fit) + (_parent as GenericStack).contentSize.Height -= this.LastSlots.Height; + else + (_parent as GenericStack).contentSize.Height += this.LastSlots.Height; + } } } |