Subtract() public static method

Translates a by the negative of a given .

public static Subtract ( Point pt, Size sz ) : Point
pt Point
sz Size
return Point
Exemplo n.º 1
0
        /// <summary>
        /// Update our coordinates to reflect a new top-left pixel
        /// </summary>
        /// <param name="topLeftXY">The top-left pixel</param>
        public void UpdateFromXY(Point topLeftXY)
        {
            var max = Point.Subtract(LngLatToXY(new PointF(180, -75), ZoomLevel), DisplayRectangle.Size);
            var min = LngLatToXY(new PointF(-180, 82), ZoomLevel);

            topLeftXY.X = Math.Max(Math.Min(max.X, topLeftXY.X), min.X);
            topLeftXY.Y = Math.Max(Math.Min(max.Y, topLeftXY.Y), min.Y);

            //Point.Subtract(TopLeftXY, DisplayRectangle.Size)

            PointF oldCenter = Center;

            //Update our top-left coordinates
            this.TopLeftXY = topLeftXY;
            this.TopLeft   = XYToLngLat(topLeftXY, ZoomLevel);

            //Determine our bottom-right pixel
            this.BottomRightXY = Point.Add(topLeftXY, DisplayRectangle.Size);
            this.BottomRight   = XYToLngLat(this.BottomRightXY, ZoomLevel);

            if (this.Panned != null)
            {
                this.Panned(oldCenter, Center);
            }
        }
Exemplo n.º 2
0
 public override bool MouseOver(Point p)
 {
     return MapControl.MapLocation == CurrentLocation || BodyLibrary != null && BodyLibrary.VisiblePixel(DrawFrame + ArmourOffSet, p.Subtract(FinalDrawLocation), false);
 }
Exemplo n.º 3
0
 public override bool IsMouseOver(Point p)
 {
     return base.IsMouseOver(p) && (!_pixelDetect || Library.VisiblePixel(Index, p.Subtract(DisplayLocation),true) || Moving);
 }
Exemplo n.º 4
0
 /// <summary>Translates a <see cref="T:System.Drawing.Point" /> by the negative of a given <see cref="T:System.Drawing.Size" />.</summary>
 /// <returns>A <see cref="T:System.Drawing.Point" /> structure that is translated by the negative of a given <see cref="T:System.Drawing.Size" /> structure.</returns>
 /// <param name="pt">The <see cref="T:System.Drawing.Point" /> to translate. </param>
 /// <param name="sz">A <see cref="T:System.Drawing.Size" /> that specifies the pair of numbers to subtract from the coordinates of <paramref name="pt" />. </param>
 /// <filterpriority>3</filterpriority>
 public static Point operator -(Point pt, Size sz)
 {
     return(Point.Subtract(pt, sz));
 }
Exemplo n.º 5
0
 public void Move(Point pPoint)
 {
     Point panDelta = pPoint.Subtract(m_panPosition);
     m_window.SetPanPosition(m_window.GetPanPosition().Add(panDelta));
 }