Translates a by the negative of a given .
/// <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); } }
public override bool MouseOver(Point p) { return MapControl.MapLocation == CurrentLocation || BodyLibrary != null && BodyLibrary.VisiblePixel(DrawFrame + ArmourOffSet, p.Subtract(FinalDrawLocation), false); }
public override bool IsMouseOver(Point p) { return base.IsMouseOver(p) && (!_pixelDetect || Library.VisiblePixel(Index, p.Subtract(DisplayLocation),true) || Moving); }
/// <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)); }
public void Move(Point pPoint) { Point panDelta = pPoint.Subtract(m_panPosition); m_window.SetPanPosition(m_window.GetPanPosition().Add(panDelta)); }