aboutsummaryrefslogtreecommitdiffstatsci
path: root/src/GraphicObjects
diff options
context:
space:
mode:
authorjpbruyere <jp.bruyere@hotmail.com>2016-10-18 11:38:37 +0200
committerjpbruyere <jp.bruyere@hotmail.com>2016-10-18 11:41:06 +0200
commit43a1802b884782921ad3b61fc63bcfefadb627bb (patch)
treeebdc55762a3baf8b416abdf39244309ff99ac503 /src/GraphicObjects
parent10554f8a78a6981f5e49e46a32b3eee5911b872e (diff)
parent7c00385bda3a9a913050480fada2efab8d6d3090 (diff)
Merge branch 'master' into CrowIDE
Diffstat (limited to 'src/GraphicObjects')
-rw-r--r--src/GraphicObjects/GraphicObject.cs16
-rw-r--r--src/GraphicObjects/Popper.cs2
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);