diff options
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; |