Skip to content

Commit

Permalink
fix(calendar): Fix setting Width and Height on Calendar does nothing
Browse files Browse the repository at this point in the history
  • Loading branch information
dr1rrb committed Jun 15, 2021
1 parent b64a6cb commit 2be72c9
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -517,11 +517,11 @@ private Rect GetLayoutViewport(Size availableSize = default)
var viewport = new Rect(
_effectiveViewport.Location.FiniteOrDefault(default),
_effectiveViewport.Size.AtLeast(availableSize).AtLeast(_defaultHardCodedSize).FiniteOrDefault(_defaultHardCodedSize));
if (calendar.HorizontalAlignment != HorizontalAlignment.Stretch)
if (calendar.HorizontalAlignment != HorizontalAlignment.Stretch && double.IsNaN(calendar.Width) && calendar.MinWidth <= 0)
{
viewport.Width = _defaultHardCodedSize.Width;
}
if (calendar.VerticalAlignment != VerticalAlignment.Stretch)
if (calendar.VerticalAlignment != VerticalAlignment.Stretch && double.IsNaN(calendar.Height) && calendar.MinHeight <= 0)
{
viewport.Height = _defaultHardCodedSize.Height;
}
Expand Down

0 comments on commit 2be72c9

Please sign in to comment.