Skip to content

Commit

Permalink
Merge pull request #301 from alfhenrik/master
Browse files Browse the repository at this point in the history
Fixes Issue #244
  • Loading branch information
VikingCode committed Jan 14, 2013
2 parents bd6aef6 + dac4987 commit 13df059
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions MahApps.Metro/Controls/Panorama.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Windows.Controls;
using System.Windows;
using System.Windows.Threading;
Expand Down Expand Up @@ -168,16 +168,14 @@ protected override void OnPreviewMouseDown(MouseButtonEventArgs e)
tile = (IPanoramaTile)data;
}
}

CaptureMouse();
}

base.OnPreviewMouseDown(e);
}

protected override void OnPreviewMouseMove(MouseEventArgs e)
{
if (IsMouseCaptured)
if (e.LeftButton == MouseButtonState.Pressed)
{
Point currentPoint = e.GetPosition(this);

Expand All @@ -194,6 +192,7 @@ protected override void OnPreviewMouseMove(MouseEventArgs e)
// Scroll to the new position.
sv.ScrollToHorizontalOffset(scrollTarget.X);
sv.ScrollToVerticalOffset(scrollTarget.Y);
CaptureMouse();
}

base.OnPreviewMouseMove(e);
Expand All @@ -203,10 +202,9 @@ protected override void OnPreviewMouseUp(MouseButtonEventArgs e)
{
if (IsMouseCaptured)
{
Cursor = Cursors.Arrow;
ReleaseMouseCapture();
}

Cursor = Cursors.Arrow;
Point currentPoint = e.GetPosition(this);

// Determine the new amount to scroll.
Expand Down

0 comments on commit 13df059

Please sign in to comment.