Browse Source

Use MathUtilities

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

4
src/Avalonia.Controls/WrapPanel.cs

@ -112,13 +112,13 @@ namespace Avalonia.Controls
//this is the size of the child in UV space //this is the size of the child in UV space
var sz = new UVSize(Orientation, child.DesiredSize.Width, child.DesiredSize.Height); var sz = new UVSize(Orientation, child.DesiredSize.Width, child.DesiredSize.Height);
if ((curLineSize.U + sz.U) > uvConstraint.U) //need to switch to another line if (MathUtilities.GreaterThan(curLineSize.U + sz.U, uvConstraint.U) //need to switch to another line
{ {
panelSize.U = Max(curLineSize.U, panelSize.U); panelSize.U = Max(curLineSize.U, panelSize.U);
panelSize.V += curLineSize.V; panelSize.V += curLineSize.V;
curLineSize = sz; curLineSize = sz;
if (sz.U > uvConstraint.U) //the element is wider then the constrint - give it a separate line if (MathUtilities.GreaterThan(sz.U, uvConstraint.U)) //the element is wider then the constrint - give it a separate line
{ {
panelSize.U = Max(sz.U, panelSize.U); panelSize.U = Max(sz.U, panelSize.U);
panelSize.V += sz.V; panelSize.V += sz.V;

Loading…
Cancel
Save