Skip to content

Commit 4dbe593

Browse files
committed
chore: スライドショー中も「ドットのまま拡大」設定は有効にした
1 parent 0105f38 commit 4dbe593

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

NeeView/ViewContents/ViewContentTools.cs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -82,18 +82,18 @@ public static void SetBitmapScalingMode(UIElement element, Size imageSize, ViewC
8282
SetBitmapScalingMode(element, scalingMode.Value);
8383
element.SnapsToDevicePixels = scalingMode.Value == BitmapScalingMode.NearestNeighbor;
8484
}
85-
// 画像サイズがビッタリの場合はドットバイドットになるような設定
86-
else if (contentSize.IsRightAngle && SizeEquals(contentSize.PixelSize, pixelSize, 1.1))
87-
{
88-
LocalDebug.WriteLine($"OO: NearestNeighbor: {pixelSize:f0} /{imageSize:f0}");
89-
SetBitmapScalingMode(element, BitmapScalingMode.NearestNeighbor);
90-
element.SnapsToDevicePixels = true;
91-
}
9285
// DotKeep mode
9386
// TODO: Config.Current参照はよろしくない
9487
else if (Config.Current.ImageDotKeep.IsImageDotKeep(contentSize.PixelSize, pixelSize))
9588
{
9689
LocalDebug.WriteLine($"XX: NearestNeighbor: {pixelSize:f0} / {imageSize:f0} != request {contentSize.PixelSize:f0}");
90+
SetBitmapScalingMode(element, BitmapScalingMode.NearestNeighbor, BitmapScalingMode.NearestNeighbor);
91+
element.SnapsToDevicePixels = true;
92+
}
93+
// 画像サイズがビッタリの場合はドットバイドットになるような設定
94+
else if (contentSize.IsRightAngle && SizeEquals(contentSize.PixelSize, pixelSize, 1.1))
95+
{
96+
LocalDebug.WriteLine($"OO: NearestNeighbor: {pixelSize:f0} /{imageSize:f0}");
9797
SetBitmapScalingMode(element, BitmapScalingMode.NearestNeighbor);
9898
element.SnapsToDevicePixels = true;
9999
}
@@ -105,13 +105,13 @@ public static void SetBitmapScalingMode(UIElement element, Size imageSize, ViewC
105105
}
106106
}
107107

108-
private static void SetBitmapScalingMode(UIElement element, BitmapScalingMode mode)
108+
private static void SetBitmapScalingMode(UIElement element, BitmapScalingMode mode, BitmapScalingMode modePlaying = BitmapScalingMode.Fant)
109109
{
110110
// スライドショー オートスクロール中は Fant にする
111111
var binding = new Binding(nameof(SlideShow.IsPlayingAutoScroll))
112112
{
113113
Source = SlideShow.Current,
114-
Converter = new BooleanToBitmapScalingModeConverter() { FalseValue = mode }
114+
Converter = new BooleanToBitmapScalingModeConverter() { FalseValue = mode, TrueValue = modePlaying }
115115
};
116116
BindingOperations.SetBinding(element, RenderOptions.BitmapScalingModeProperty, binding);
117117
}

0 commit comments

Comments
 (0)