diff --git a/src/Perspex.Controls/Image.cs b/src/Perspex.Controls/Image.cs index 0782b51f2a..79b79c6141 100644 --- a/src/Perspex.Controls/Image.cs +++ b/src/Perspex.Controls/Image.cs @@ -73,29 +73,14 @@ namespace Perspex.Controls /// The desired size of the control. protected override Size MeasureOverride(Size availableSize) { - double width = 0; - double height = 0; - Vector scale = new Vector(); - if (Source != null) { - width = Source.PixelWidth; - height = Source.PixelHeight; - - if (Width > 0) - { - availableSize = new Size(Width, availableSize.Height); - } - - if (Height > 0) - { - availableSize = new Size(availableSize.Width, Height); - } - - scale = Stretch.CalculateScaling(availableSize, new Size(width, height)); + return new Size(Source.PixelWidth, Source.PixelHeight); + } + else + { + return new Size(); } - - return new Size(width * scale.X, height * scale.Y); } } } \ No newline at end of file