示例#1
0
        static float GetTop(CensorOverlaySettings OverlaySettings, float FullHeight)
        {
            var y = OverlaySettings.Y;

            switch (OverlaySettings.VerticalAlignment)
            {
            case Alignment.Start:
                return(y);

            case Alignment.End:
                return(FullHeight - y - OverlaySettings.Height);

            case Alignment.Center:
                return(FullHeight / 2 + y - OverlaySettings.Height / 2f);

            default:
                return(0);
            }
        }
示例#2
0
        static float GetLeft(CensorOverlaySettings OverlaySettings, float FullWidth)
        {
            var x = OverlaySettings.X;

            switch (OverlaySettings.HorizontalAlignment)
            {
            case Alignment.Start:
                return(x);

            case Alignment.End:
                return(FullWidth - x - OverlaySettings.Width);

            case Alignment.Center:
                return(FullWidth / 2 + x - OverlaySettings.Width / 2f);

            default:
                return(0);
            }
        }