diff options
| author | jpbruyere <jp.bruyere@hotmail.com> | 2016-10-18 11:38:37 +0200 |
|---|---|---|
| committer | jpbruyere <jp.bruyere@hotmail.com> | 2016-10-18 11:41:06 +0200 |
| commit | 43a1802b884782921ad3b61fc63bcfefadb627bb (patch) | |
| tree | ebdc55762a3baf8b416abdf39244309ff99ac503 /src/GraphicObjects | |
| parent | 10554f8a78a6981f5e49e46a32b3eee5911b872e (diff) | |
| parent | 7c00385bda3a9a913050480fada2efab8d6d3090 (diff) | |
Merge branch 'master' into CrowIDE
Diffstat (limited to 'src/GraphicObjects')
| -rw-r--r-- | src/GraphicObjects/GraphicObject.cs | 16 | ||||
| -rw-r--r-- | src/GraphicObjects/Popper.cs | 2 |
2 files changed, 13 insertions, 5 deletions
diff --git a/src/GraphicObjects/GraphicObject.cs b/src/GraphicObjects/GraphicObject.cs index 093664d1..e69aaaca 100644 --- a/src/GraphicObjects/GraphicObject.cs +++ b/src/GraphicObjects/GraphicObject.cs @@ -276,9 +276,13 @@ namespace Crow Width = Height = Measure.Fit; } } - [XmlAttributeAttribute()][DefaultValue("Stretched")] + [XmlAttributeAttribute()][DefaultValue("Inherit")] public virtual Measure Width { - get { return width; } + get { + return width.Units == Unit.Inherit ? + Parent is GraphicObject ? (Parent as GraphicObject).WidthPolicy : + Measure.Stretched : width; + } set { if (width == value) return; @@ -308,9 +312,13 @@ namespace Crow this.RegisterForLayouting (LayoutingType.Width); } } - [XmlAttributeAttribute()][DefaultValue("Stretched")] + [XmlAttributeAttribute()][DefaultValue("Inherit")] public virtual Measure Height { - get { return height; } + get { + return height.Units == Unit.Inherit ? + Parent is GraphicObject ? (Parent as GraphicObject).HeightPolicy : + Measure.Stretched : height; + } set { if (height == value) return; diff --git a/src/GraphicObjects/Popper.cs b/src/GraphicObjects/Popper.cs index 1bfdf19c..669b8d7f 100644 --- a/src/GraphicObjects/Popper.cs +++ b/src/GraphicObjects/Popper.cs @@ -119,7 +119,7 @@ namespace Crow protected void _content_LayoutChanged (object sender, LayoutingEventArgs e) { - ILayoutable tc = Content.Parent as ILayoutable; + ILayoutable tc = Content.Parent; if (tc == null) return; Rectangle r = this.ScreenCoordinates (this.Slot); |