Skip to content

Commit ace3a7e

Browse files
committed
Merge branch 'main' into PanZoomRewrite
2 parents bd43120 + bc2e328 commit ace3a7e

3 files changed

Lines changed: 8 additions & 3 deletions

File tree

Src/FlyPhotos/Display/Controllers/ThumbNailController.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,9 @@ public void RedrawThumbNailsIfNeeded(int updatedKey)
149149

150150
private void D2dCanvasThumbNail_PointerPressed(object sender, Microsoft.UI.Xaml.Input.PointerRoutedEventArgs e)
151151
{
152+
if (e.GetCurrentPoint(_d2dCanvasThumbNail).Properties.PointerUpdateKind
153+
is not Microsoft.UI.Input.PointerUpdateKind.LeftButtonPressed) return;
154+
152155
var keys = _getSortedPhotoKeys?.Invoke();
153156
if (keys == null || keys.Count <= 1) return;
154157

Src/FlyPhotos/UI/Behaviors/CtrlDragWindowMover.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ private void OnPointerPressed(object sender, PointerRoutedEventArgs e)
6060
{
6161
if (!Util.IsControlPressed()) return;
6262
var point = e.GetCurrentPoint(_canvas);
63-
if (!point.Properties.IsLeftButtonPressed) return;
63+
if (point.Properties.PointerUpdateKind != Microsoft.UI.Input.PointerUpdateKind.LeftButtonPressed) return;
6464
// The `{ State: Restored }` member read roots the OverlappedPresenter projection so this cast
6565
// resolves under NativeAOT + Release; a memberless `is/as OverlappedPresenter` can silently
6666
// return null there (Debug/non-AOT are fine). Refs: CsWinRT#1930, microsoft-ui-xaml#10471.

Src/FlyPhotos/UI/Views/PhotoDisplayWindow.xaml.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -505,7 +505,7 @@ private void D2dCanvas_PointerPressed(object sender, PointerRoutedEventArgs e)
505505
return;
506506
}
507507

508-
if (updateKind == Microsoft.UI.Input.PointerUpdateKind.LeftButtonPressed || pointerPoint.Properties.IsLeftButtonPressed)
508+
if (updateKind == Microsoft.UI.Input.PointerUpdateKind.LeftButtonPressed)
509509
{
510510
if (!_canvasController.IsPressedOnImage(dpiAdjustedPos)) return;
511511
if (_ctrlDragWindowMover.Enabled && Util.IsControlPressed()) return;
@@ -519,7 +519,9 @@ private void D2dCanvas_PointerPressed(object sender, PointerRoutedEventArgs e)
519519
private void D2dCanvas_PointerMoved(object sender, PointerRoutedEventArgs e)
520520
{
521521
if (!_isDragging) return;
522-
var currentPoint = e.GetCurrentPoint(D2dCanvas).Position;
522+
var pp = e.GetCurrentPoint(D2dCanvas);
523+
if (!pp.Properties.IsLeftButtonPressed) { _isDragging = false; return; }
524+
var currentPoint = pp.Position;
523525
// Calculate logical delta
524526
double deltaX = currentPoint.X - _lastPoint.X;
525527
double deltaY = currentPoint.Y - _lastPoint.Y;

0 commit comments

Comments
 (0)