Exemple #1
0
        protected override Tuple <bool, double> allocateY(Size size)
        {
            var barrier = DanmakuLib.getPosition(pool.FindAll((i) =>
            {
                var x = ((TranslateTransform)i.RenderTransform).X;
                return(x - DanmakuConfig.HORIZONTAL_PADDING < 0);
            }));

            return(DanmakuLib.getSlotFromTop(size, offset, canvas.Height, barrier));
        }
Exemple #2
0
        protected override Tuple <bool, double> allocateY(Size size)
        {
            // 获取出可能阻挡新弹幕的旧弹幕
            var barrier = DanmakuLib.getPosition(pool.FindAll((i) =>
            {
                var x = ((TranslateTransform)i.RenderTransform).X;
                if (x <= 0)
                {
                    x = canvas.Width;
                }
                return(i.ActualWidth + x + DanmakuConfig.HORIZONTAL_PADDING > canvas.Width);
            }));

            return(DanmakuLib.getSlotFromTop(size, offset, canvas.Height, barrier));
        }
Exemple #3
0
        protected override Tuple <bool, double> allocateY(Size size)
        {
            var barrier = DanmakuLib.getPosition(pool);

            return(DanmakuLib.getSlotFromBottom(size, offset, canvas.Height, barrier));
        }