예제 #1
0
        public static TimeSpan CalcStreamCommentReachToScreenLeftEdge(CommentUI second, double canvasWidth)
        {
            var secondDisplayTime = second.EndPosition - second.VideoPosition;

            // 1msあたりの secondコメントの移動量
            var secondSpeed = ((float)canvasWidth + second.TextWidth) / (float)secondDisplayTime.TotalMilliseconds;

            // 時間 = 距離 ÷ 速さ
            var timeToSecondCommentWidthMove = TimeSpan.FromMilliseconds(second.TextWidth / secondSpeed);

            return(timeToSecondCommentWidthMove);
        }
예제 #2
0
 public static bool IsStreamCommentColide(CommentUI first, CommentUI second, double canvasWidth)
 {
     return(first.EndPosition > CalcStreamCommentReachToScreenLeftEdge(second, canvasWidth));
 }