Skip to content

Commit 9df0e91

Browse files
committed
Only consider flowing children when performing layout of text flow
Fixes one part of ppy/osu#32348. The reason this is required is due to the game-side abuse done by `DrawableLinkCompiler` & co. See the following: https://github.com/ppy/osu/blob/4633f635a4137d6af902187e12d6fc360bc3a50d/osu.Game/Graphics/Containers/LinkFlowContainer.cs#L141-L144 `FillFlowContainer` performs layout computations on `FlowingChildren` specifically: https://github.com/ppy/osu-framework/blob/1ccf0376c4306cb4077d0e3230f60efb92ea7803/osu.Framework/Graphics/Containers/FillFlowContainer.cs#L113 Because of this, if using `Flow.Children` in `TextFlowContainer`, the `DrawableLinkCompiler` - which was skipped by the inner fill flow - is now being considered for layout at the text flow level. Text flow sees that the X position of the compiler is 0 (because it wasn't touched by the inner fill flow), and thus thinks it must be a line break, which it's not. So we use `FlowingChildren` to restore parity.
1 parent 1ccf037 commit 9df0e91

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

osu.Framework/Graphics/Containers/TextFlowContainer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,7 @@ private void computeLayout()
404404
var childrenByLine = new List<List<Drawable>>();
405405
var curLine = new List<Drawable>();
406406

407-
foreach (var c in Flow.Children)
407+
foreach (var c in Flow.FlowingChildren)
408408
{
409409
if (c is NewLineContainer nlc)
410410
{

0 commit comments

Comments
 (0)