Merge pull request #4990 from OmrSi/current-position-tooltip-flicker-patch

Try to fix current position flickering issue
This commit is contained in:
Nikolaj Olsson 2021-04-15 20:14:39 +02:00 committed by GitHub
commit bf6f5abfd0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -123,6 +123,8 @@ namespace Nikse.SubtitleEdit.Controls
private readonly Label _labelVideoPlayerName = new Label();
private readonly Label _labelVolume = new Label();
private readonly ToolTip _currentPositionToolTip = new ToolTip();
private int _lastCurrentPositionToolTipX;
private int _lastCurrentPositionToolTipY;
private List<MatroskaChapter> _chapters = null;
public List<MatroskaChapter> Chapters
@ -1788,7 +1790,12 @@ namespace Nikse.SubtitleEdit.Controls
if (VideoPlayer != null)
{
string toolTiptext = CurrentPositionToolTipText(e.X - 4);
_currentPositionToolTip.Show(toolTiptext, _pictureBoxProgressbarBackground, e.X - 10, e.Y - 25);
if (e.X != _lastCurrentPositionToolTipX || e.Y != _lastCurrentPositionToolTipY)
{
_currentPositionToolTip.Show(toolTiptext, _pictureBoxProgressbarBackground, e.X - 10, e.Y - 25);
_lastCurrentPositionToolTipX = e.X;
_lastCurrentPositionToolTipY = e.Y;
}
}
}