예제 #1
0
파일: Air.cs 프로젝트: oxy0723/M4ple-Editor
        /// <summary>
        /// 真上向きAirのGraphicsPathを返します
        /// </summary>
        /// <returns></returns>
        protected virtual GraphicsPath GetAirPath(Point drawLocation)
        {
            GraphicsPath graphicsPath = new GraphicsPath();
            PointF       baseLocation = Location.Add(-drawLocation.X, -drawLocation.Y);
            PointF       topCenter    = baseLocation.AddX(Width / 2f).AddY(borderWidth).Add(drawOffset);
            PointF       topRight     = topCenter.AddX(Width / 2f - (Size - 1) * widthRatio).AddY(airHeight - airLineHeight - borderWidth);
            PointF       topLeft      = topCenter.AddX(-(Width / 2f - (Size - 1) * widthRatio)).AddY(airHeight - airLineHeight - borderWidth);
            PointF       bottomCenter = topCenter.AddY(airLineHeight - borderWidth);
            PointF       bottomRight  = topRight.AddY(airLineHeight - borderWidth);
            PointF       bottomLeft   = topLeft.AddY(airLineHeight - borderWidth);

            graphicsPath.AddLines(new PointF[] { topCenter, topRight, bottomRight, bottomCenter, bottomLeft, topLeft });
            graphicsPath.CloseFigure();
            return(graphicsPath);
        }