From 8edb058b753532a17002c2e851c483a63d839e24 Mon Sep 17 00:00:00 2001 From: jpbruyere Date: Tue, 13 Sep 2016 11:46:07 +0200 Subject: [PATCH] =?utf8?q?simplified=20SizePolicy=20check=20=09modifi?= =?utf8?q?=C3=A9=C2=A0:=20=20=20=20=20=20=20=20=20src/GraphicObjects/Graph?= =?utf8?q?icObject.cs=20=09modifi=C3=A9=C2=A0:=20=20=20=20=20=20=20=20=20s?= =?utf8?q?rc/Measure.cs?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/GraphicObjects/GraphicObject.cs | 6 ++---- src/Measure.cs | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/GraphicObjects/GraphicObject.cs b/src/GraphicObjects/GraphicObject.cs index 03e8a362..ffa2d480 100644 --- a/src/GraphicObjects/GraphicObject.cs +++ b/src/GraphicObjects/GraphicObject.cs @@ -341,15 +341,13 @@ namespace Crow /// Fit or Stretched /// [XmlIgnore]public virtual Measure WidthPolicy { get { - return Width.Units == Unit.Percent || Width.IsFixed ? - Measure.Stretched : Measure.Fit; } } + return Width.IsFit ? Measure.Fit : Measure.Stretched; } } /// /// Used for binding on dimensions, this property will never hold fixed size, but instead only /// Fit or Stretched /// [XmlIgnore]public virtual Measure HeightPolicy { get { - return Height.Units == Unit.Percent || Height.IsFixed ? - Measure.Stretched : Measure.Fit; } } + return Height.IsFit ? Measure.Fit : Measure.Stretched; } } [XmlAttributeAttribute()][DefaultValue(false)] public virtual bool Focusable { get { return focusable; } diff --git a/src/Measure.cs b/src/Measure.cs index 19e8f548..c9b08f22 100644 --- a/src/Measure.cs +++ b/src/Measure.cs @@ -62,7 +62,7 @@ namespace Crow /// True is size is fixed in pixels, this means not proportional, stretched nor fit. /// public bool IsFixed { get { return Value > 0 && Units == Unit.Pixel; }} - + public bool IsFit { get { return Value == -1 && Units == Unit.Pixel; }} #region Operators public static implicit operator int(Measure m){ return m.Value; -- 2.47.3