This commit is contained in:
NaBian 2021-07-23 00:07:44 +08:00
parent 07e7fb1296
commit b525a2ffcc

View File

@ -110,7 +110,7 @@ namespace HandyControl.Controls
}
_transform.X = p.X - _previewContent.ActualWidth * 0.5;
_transform.Y = -_previewContent.ActualHeight - PreviewContentOffset;
_transform.Y = _thumb.TranslatePoint(new Point(), _adorner).Y - _previewContent.ActualHeight - PreviewContentOffset;
PreviewPosition = _thumb.IsMouseCaptureWithin ? Value : pos;
}
@ -128,7 +128,7 @@ namespace HandyControl.Controls
return;
}
_transform.X = -_previewContent.ActualWidth - PreviewContentOffset;
_transform.X = _thumb.TranslatePoint(new Point(), _adorner).X -_previewContent.ActualWidth - PreviewContentOffset;
_transform.Y = p.Y - _previewContent.ActualHeight * 0.5;
PreviewPosition = _thumb.IsMouseCaptureWithin ? Value : pos;
@ -194,18 +194,10 @@ namespace HandyControl.Controls
if (_previewContent != null)
{
_transform = new TranslateTransform();
_previewContent.RenderTransform = _transform;
if (Orientation == Orientation.Horizontal)
{
_previewContent.HorizontalAlignment = HorizontalAlignment.Left;
_previewContent.VerticalAlignment = VerticalAlignment.Center;
}
else
{
_previewContent.HorizontalAlignment = HorizontalAlignment.Center;
_previewContent.VerticalAlignment = VerticalAlignment.Top;
}
_previewContent.HorizontalAlignment = HorizontalAlignment.Left;
_previewContent.VerticalAlignment = VerticalAlignment.Top;
_previewContent.RenderTransform = _transform;
}
}
}