Browse Source

Update WrapPanel.cs

pull/2596/head
Wiesław Šoltés 7 years ago
parent
commit
62b8c679ea
  1. 4
      src/Avalonia.Controls/WrapPanel.cs

4
src/Avalonia.Controls/WrapPanel.cs

@ -156,14 +156,14 @@ namespace Avalonia.Controls
var sz = new UVSize(Orientation, child.DesiredSize.Width, child.DesiredSize.Height);
if ((curLineSize.U + sz.U) > uvFinalSize.U) //need to switch to another line
if (MathUtilities.GreaterThan(curLineSize.U + sz.U, uvFinalSize.U)) //need to switch to another line
{
arrangeLine(accumulatedV, curLineSize.V, firstInLine, i);
accumulatedV += curLineSize.V;
curLineSize = sz;
if (sz.U > uvFinalSize.U) //the element is wider then the constraint - give it a separate line
if (MathUtilities.GreaterThan(sz.U, uvFinalSize.U)) //the element is wider then the constraint - give it a separate line
{
//switch to next line which only contain one element
arrangeLine(accumulatedV, sz.V, i, ++i);

Loading…
Cancel
Save