Skip to content

Commit b16256e

Browse files
committed
Avoid fill flow layout flipping between floating point precisions
1 parent 1c92a7b commit b16256e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

osu.Framework/Graphics/Containers/FlowContainer.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
using System.Linq;
1010
using osu.Framework.Graphics.Transforms;
1111
using osu.Framework.Layout;
12+
using osu.Framework.Utils;
1213
using osuTK;
1314

1415
namespace osu.Framework.Graphics.Containers
@@ -206,7 +207,7 @@ private void performLayout()
206207
var existingTransform = drawable.TransformsForTargetMember(FlowTransform.TARGET_MEMBER).FirstOrDefault(x => x is FlowTransform) as FlowTransform;
207208
Vector2 currentTargetPos = existingTransform?.EndValue ?? drawable.Position;
208209

209-
if (currentTargetPos == pos) continue;
210+
if (Precision.AlmostEquals(currentTargetPos, pos)) continue;
210211

211212
if (LayoutDuration > 0)
212213
drawable.TransformTo(drawable.PopulateTransform(new FlowTransform { Rewindable = false }, pos, LayoutDuration, LayoutEasing));

0 commit comments

Comments
 (0)