Make sure snapping distance is calculated without changing zoom level first

This commit is contained in:
Martijn van Berkel (Flitskikker) 2023-07-17 22:20:23 +02:00
parent 2d92e9e702
commit 634f7a37bb

View File

@ -131,6 +131,7 @@ namespace Nikse.SubtitleEdit.Controls
private double _zoomFactor = 1.0; // 1.0=no zoom
public int ShotChangeSnapPixels = 8;
private bool _snappingDistanceFirstUpdated = false;
public double ZoomFactor
{
@ -327,6 +328,11 @@ namespace Nikse.SubtitleEdit.Controls
_subtitle = new Subtitle();
_noClear = false;
_wavePeaks = value;
if (!_snappingDistanceFirstUpdated)
{
UpdateSnappingDistance();
}
}
}
@ -2734,6 +2740,7 @@ namespace Nikse.SubtitleEdit.Controls
var snappingDistance = (int) Math.Round(pixelsPerFrame * Math.Max(1, largestGapInFrames));
ShotChangeSnapPixels = Math.Max(8, snappingDistance);
_snappingDistanceFirstUpdated = true;
}
else
{