/// <summary> /// re-compute layout /// </summary> protected override IEnumerable <Vector2> ComputeLayoutPositions() { //the child that only display on the screen var children = FlowingChildren.ToArray(); if (children.Length == 0) { return(new List <Vector2>()); } Vector2[] result = new Vector2[children.Length]; for (int i = 0; i < children.Length; i++) { var drawableLyric = Children.FirstOrDefault(x => x == children[i]); if (drawableLyric != null) { if (drawableLyric.DisplayLayer != 0) { var pervous = Children.GetPrevious(drawableLyric); var next = Children.GetNext(drawableLyric); var perviousHeight = pervous?.Y + pervous?.DrawHeight ?? 0; var nextHeight = next?.Y + next?.DrawHeight ?? 0; result[i].Y = Math.Max(perviousHeight, nextHeight); } } } return(result); }