// This scrolls anywhere private void ScrollBy(float deltax, float deltay) { // Scroll now renderer2d.PositionView(renderer2d.OffsetX + deltax, renderer2d.OffsetY + deltay); this.OnViewChanged(); // Redraw General.MainWindow.RedrawDisplay(); // Determine new unprojected mouse coordinates mousemappos = renderer2d.DisplayToMap(mousepos); General.MainWindow.UpdateCoordinates(mousemappos); }
// This scrolls anywhere private void ScrollBy(float deltax, float deltay) { //mxd. Don't stroll too far from map boundaries Vector2D offset = ClampViewOffset(renderer2d.OffsetX + deltax, renderer2d.OffsetY + deltay); // Scroll now renderer2d.PositionView(offset.x, offset.y); this.OnViewChanged(); // Redraw General.MainWindow.RedrawDisplay(); // Determine new unprojected mouse coordinates mousemappos = renderer2d.DisplayToMap(mousepos); General.MainWindow.UpdateCoordinates(mousemappos, true); }