Skip to content

Commit 4d01bf9

Browse files
committed
Merge remote-tracking branch 'upstream/dev' into dev
2 parents 070202f + e82dc04 commit 4d01bf9

File tree

5 files changed

+32
-10
lines changed

5 files changed

+32
-10
lines changed

.github/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ Enjoy a clean, free, and fast experience with no annoying pop-ups, and zero trac
2020

2121
# Downloads
2222

23-
[![](https://img.shields.io/badge/Windows-x64-blue?style=flat-square&logo=windows&logoColor=fff)](https://github.com/Ruben2776/PicView/releases/download/4.1.1/Setup-PicView-v4.1.1-win-x64.exe) [![](https://img.shields.io/badge/Windows-arm64-blue?style=flat-square&logo=windows&logoColor=fff)](https://github.com/Ruben2776/PicView/releases/download/4.1.1/Setup-PicView-v4.1.1-win-arm64.exe)
23+
[![](https://img.shields.io/badge/Windows-x64-blue?style=flat-square&logo=windows&logoColor=fff)](https://github.com/Ruben2776/PicView/releases/download/4.1.2/Setup-PicView-v4.1.2-win-x64.exe) [![](https://img.shields.io/badge/Windows-arm64-blue?style=flat-square&logo=windows&logoColor=fff)](https://github.com/Ruben2776/PicView/releases/download/4.1.2/Setup-PicView-v4.1.2-win-arm64.exe)
2424

25-
[![](https://img.shields.io/badge/macOS-arm64%20(Apple%20Silicon)-blueviolet?style=flat-square&logo=apple&logoColor=fff)](https://github.com/Ruben2776/PicView/releases/download/4.1.1/PicView-4.1.1-macOS-arm64.dmg)
26-
[![](https://img.shields.io/badge/macOS-x64-blueviolet?style=flat-square&logo=apple&logoColor=fff)](https://github.com/Ruben2776/PicView/releases/download/4.1.1/PicView-4.1.1-macOS-x64.dmg)
25+
[![](https://img.shields.io/badge/macOS-arm64%20(Apple%20Silicon)-blueviolet?style=flat-square&logo=apple&logoColor=fff)](https://github.com/Ruben2776/PicView/releases/download/4.1.2/PicView-4.1.2-macOS-arm64.dmg)
26+
[![](https://img.shields.io/badge/macOS-x64-blueviolet?style=flat-square&logo=apple&logoColor=fff)](https://github.com/Ruben2776/PicView/releases/download/4.1.2/PicView-4.1.2-macOS-x64.dmg)
2727

2828
[Latest releases at PicView.org](https://picview.org/download)
2929

src/Directory.Build.props

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
<PropertyGroup>
33
<Nullable>enable</Nullable>
44
<AvaloniaVersion>11.3.8</AvaloniaVersion>
5-
<VersionPrefix>4.1.1</VersionPrefix>
5+
<VersionPrefix>4.1.2</VersionPrefix>
66
<VersionSuffix></VersionSuffix>
7-
<AssemblyVersion>4.1.1.0</AssemblyVersion>
8-
<FileVersion>4.1.1</FileVersion>
7+
<AssemblyVersion>4.1.2.0</AssemblyVersion>
8+
<FileVersion>4.1.2</FileVersion>
99
</PropertyGroup>
1010
</Project>

src/PicView.Avalonia/CustomControls/ZoomPanControl.cs

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,8 @@ public void ResetZoomSlim()
199199
SetScaleImmediate(1.0, CenterPoint());
200200

201201
SetZoomValue(100);
202+
203+
_zoomPreviewer?.SetInvisible();
202204
}
203205

204206
/// <summary>
@@ -232,6 +234,9 @@ public void SetConstrainedTranslation(double translateX, double translateY)
232234
TranslateY = translateY;
233235
ConstrainTranslationToBounds();
234236
UpdateChildTransform();
237+
238+
// Update preview window after transform change
239+
UpdatePreviewWindow();
235240
}
236241

237242
#endregion
@@ -301,6 +306,9 @@ private void HandlePanning(object? sender, PointerEventArgs e)
301306

302307
ConstrainTranslationToBounds();
303308
UpdateChildTransform();
309+
310+
// Update preview window after transform change
311+
UpdatePreviewWindow();
304312
}
305313

306314
private void StopPanning(object? sender, PointerReleasedEventArgs e)
@@ -354,6 +362,9 @@ private void ZoomBy(double targetScale, bool animated = true, Point? zoomAtPoint
354362
{
355363
ResetZoom(animated);
356364
}
365+
366+
// Update preview window after transform change
367+
UpdatePreviewWindow();
357368
}
358369

359370
private void ApplyZoomAndTitle(double targetScale, Point center, bool animated)
@@ -441,9 +452,6 @@ private void UpdateChildTransform()
441452
_scaleTransform.ScaleY = Scale;
442453
_translateTransform.X = TranslateX;
443454
_translateTransform.Y = TranslateY;
444-
445-
// Update preview window after transform change
446-
UpdatePreviewWindow();
447455
}
448456

449457
private void SetTransitions(bool isAnimated)

src/PicView.Avalonia/StartUp/QuickLoad.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,11 @@ public static async ValueTask QuickLoadAsync(MainViewModel vm, string file, Wind
3939
vm.MainWindow.IsLoadingIndicatorShown.Value = true;
4040
Dispatcher.UIThread.Invoke(window.Show, DispatcherPriority.Send);
4141
await NavigationManager.LoadPicFromStringAsync(file, vm).ConfigureAwait(false);
42+
if (Settings.WindowProperties.AutoFit)
43+
{
44+
await Dispatcher.UIThread.InvokeAsync(() => { WindowFunctions.CenterWindowOnScreen(); },
45+
DispatcherPriority.Send);
46+
}
4247
return;
4348
}
4449

@@ -47,6 +52,11 @@ public static async ValueTask QuickLoadAsync(MainViewModel vm, string file, Wind
4752
vm.MainWindow.IsLoadingIndicatorShown.Value = true;
4853
Dispatcher.UIThread.Invoke(window.Show, DispatcherPriority.Send);
4954
await NavigationManager.LoadPicFromArchiveAsync(file, vm).ConfigureAwait(false);
55+
if (Settings.WindowProperties.AutoFit)
56+
{
57+
await Dispatcher.UIThread.InvokeAsync(() => { WindowFunctions.CenterWindowOnScreen(); },
58+
DispatcherPriority.Send);
59+
}
5060
return;
5161
}
5262

src/PicView.Avalonia/Views/UC/ZoomPreviewer.axaml.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,13 +285,17 @@ private void UpdateSize(MainViewModel vm)
285285

286286
private void RestartHideTimer()
287287
{
288+
if (Opacity is 0)
289+
{
290+
return;
291+
}
288292
_hideTimer?.Dispose();
289293
_hideTimer = new Timer(_ =>
290294
{
291295
Dispatcher.UIThread.Invoke(async () =>
292296
{
293297
// Only hide if we're not dragging
294-
if (!_isDragging && !IsPointerOver)
298+
if (!_isDragging && !IsPointerOver && _zoomPanControl.Scale is not 1.0)
295299
{
296300
var opacityAnim = AnimationsHelper.OpacityAnimation(1, 0, TimeSpan.FromSeconds(0.5));
297301
await opacityAnim.RunAsync(this);

0 commit comments

Comments
 (0)