VectorMath.RectangleD.Contains C# (CSharp) Method

Contains() public method

public Contains ( DVector2 other ) : bool
other DVector2
return bool
        public bool Contains(DVector2 other)
        {
            return (other.X > Left && other.X < Right && other.Y > Top && other.Y < Bottom);
        }

Usage Example

示例#1
0
        public void Draw(Graphics graphics, RectangleD cameraBounds, IMapRenderable orbitingBody)
        {
            var traceBounds = new List<RectangleF>();

            for (int i = 1; i < _points.Count; i++)
            {
                DVector2 orbitPoint = _points[i];

                if (cameraBounds.Contains(orbitPoint))
                {
                    PointF localPoint = RenderUtils.WorldToScreen(orbitPoint, cameraBounds);

                    if (i == _apogeeIndex && i > 1)
                    {
                        RenderApogee(graphics, localPoint);
                    }
                    else if (i == _perigeeIndex)
                    {
                        RenderPerigee(graphics, localPoint);
                    }
                    else
                    {
                        traceBounds.Add(new RectangleF(localPoint.X, localPoint.Y, 2, 2));
                    }
                }
            }

            if (_points.Count > 0 && cameraBounds.Contains(_points[0]))
            {
                RenderStart(graphics, cameraBounds, orbitingBody, _points[0]);
            }

            RenderUtils.DrawRectangles(graphics, traceBounds, orbitingBody.IconColor);
        }
All Usage Examples Of VectorMath.RectangleD::Contains