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/GraphicObject.cs | |
| parent | 10554f8a78a6981f5e49e46a32b3eee5911b872e (diff) | |
| parent | 7c00385bda3a9a913050480fada2efab8d6d3090 (diff) | |
Merge branch 'master' into CrowIDE
Diffstat (limited to 'src/GraphicObjects/GraphicObject.cs')
| -rw-r--r-- | src/GraphicObjects/GraphicObject.cs | 16 |
1 files changed, 12 insertions, 4 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; |