From f73cd6ba5c86edf6cfe46526fe94fbaccc5e23a5 Mon Sep 17 00:00:00 2001 From: OmrSi Date: Thu, 15 Apr 2021 21:12:16 +0300 Subject: [PATCH] Try to fix current position flickering issue --- src/ui/Controls/VideoPlayerContainer.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/ui/Controls/VideoPlayerContainer.cs b/src/ui/Controls/VideoPlayerContainer.cs index 5b24a0a47..a49189dee 100644 --- a/src/ui/Controls/VideoPlayerContainer.cs +++ b/src/ui/Controls/VideoPlayerContainer.cs @@ -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 _chapters = null; public List 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; + } } }