Revert "Throttle scroll position update" (#3660)

This reverts commit 1177815f81.
This commit is contained in:
Dustin L. Howett (MSFT) 2019-11-21 16:26:21 -08:00 committed by GitHub
parent 62d7f11b4a
commit 714d79e2c8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 0 additions and 21 deletions

View file

@ -21,10 +21,6 @@ using namespace winrt::Windows::UI::Core;
using namespace winrt::Windows::System;
using namespace winrt::Microsoft::Terminal::Settings;
// Limit the rate of scroll update operation
// See also: Microsoft::Console::Render::RenderThread::s_FrameLimitMilliseconds
constexpr long long ScrollRateLimitMilliseconds = 8;
namespace winrt::Microsoft::Terminal::TerminalControl::implementation
{
// Helper static function to ensure that all ambiguous-width glyphs are reported as narrow.
@ -59,7 +55,6 @@ namespace winrt::Microsoft::Terminal::TerminalControl::implementation
_settings{ settings },
_closing{ false },
_lastScrollOffset{ std::nullopt },
_lastScrollTime{ std::nullopt },
_autoScrollVelocity{ 0 },
_autoScrollingPointerPoint{ std::nullopt },
_autoScrollTimer{},
@ -1457,21 +1452,6 @@ namespace winrt::Microsoft::Terminal::TerminalControl::implementation
return;
}
// Throttle the update operation.
const auto timeNow = std::chrono::high_resolution_clock::now();
if (_lastScrollTime.has_value())
{
const long long deltaTimeInMilliSec = std::chrono::duration_cast<std::chrono::milliseconds>(timeNow - _lastScrollTime.value()).count();
if (deltaTimeInMilliSec < ScrollRateLimitMilliseconds)
{
_lastScrollTime = std::nullopt;
return;
}
}
_lastScrollTime = timeNow;
// Update our scrollbar
_scrollBar.Dispatcher().RunAsync(CoreDispatcherPriority::Low, [=]() {
// Even if we weren't closed/closing few lines above, we might be

View file

@ -118,7 +118,6 @@ namespace winrt::Microsoft::Terminal::TerminalControl::implementation
FontInfo _actualFont;
std::optional<int> _lastScrollOffset;
std::optional<std::chrono::high_resolution_clock::time_point> _lastScrollTime;
// Auto scroll occurs when user, while selecting, drags cursor outside viewport. View is then scrolled to 'follow' the cursor.
double _autoScrollVelocity;