private void ScrollViewerAdjustableSizeMapMouseMove(object sender, MouseEventArgs e) { if (m_LastDragPoint.HasValue) { var posNow = e.GetPosition(ScrollViewerAdjustableSizeMap); var dX = posNow.X - m_LastDragPoint.Value.X; var dY = posNow.Y - m_LastDragPoint.Value.Y; m_LastDragPoint = posNow; ScrollViewerAdjustableSizeMap.ScrollToHorizontalOffset(ScrollViewerAdjustableSizeMap.HorizontalOffset - dX); ScrollViewerAdjustableSizeMap.ScrollToVerticalOffset(ScrollViewerAdjustableSizeMap.VerticalOffset - dY); } }
private void ScrollViewerAdjustableSizeMapMouseMove(object sender, MouseEventArgs e) { if (m_LastDragPoint.HasValue) { var posNow = e.GetPosition(ScrollViewerAdjustableSizeMap); var dX = posNow.X - m_LastDragPoint.Value.X; var dY = posNow.Y - m_LastDragPoint.Value.Y; m_LastDragPoint = posNow; ScrollViewerAdjustableSizeMap.ScrollToHorizontalOffset(ScrollViewerAdjustableSizeMap.HorizontalOffset - dX); ScrollViewerAdjustableSizeMap.ScrollToVerticalOffset(ScrollViewerAdjustableSizeMap.VerticalOffset - dY); if (e.LeftButton == MouseButtonState.Pressed) { SetMiniMapBorderRange(); } } }