Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Snap to character grid when resizing window #3181

Merged
merged 29 commits into from
Jan 8, 2020
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
b8a5725
Kinda works, no splitted panes
mcpiroman Sep 24, 2019
68f613b
Calc sizes more accurately
mcpiroman Sep 26, 2019
5d0f1d3
General work, add resolution for children along resize axis
mcpiroman Sep 28, 2019
90649b2
Partially fix child displacement
mcpiroman Sep 29, 2019
cbda911
Change child layout algorithm, now 100% correct
mcpiroman Oct 5, 2019
d69f8ed
Cache padding and scrollbar width, fix infinite loop
mcpiroman Oct 5, 2019
b732e74
(drastically) optimize layout algorithm ( O(n^m) -> O(n) )
mcpiroman Oct 10, 2019
0ecbec5
Fix minimum pane size calculation
mcpiroman Oct 11, 2019
3dcd00f
Style, comments, format; fix layout just after split
mcpiroman Oct 12, 2019
583541d
Review changes
mcpiroman Oct 16, 2019
b00fef8
Fix rebase
mcpiroman Oct 18, 2019
5e9b31c
Undo caching of padding and scrollbar size
mcpiroman Nov 5, 2019
bed02c5
Some review changes
mcpiroman Nov 6, 2019
76d4945
Merge with master
mcpiroman Nov 7, 2019
9a95e18
Fix height calculation in non client window
mcpiroman Nov 11, 2019
11fcd51
Some additional comments I had time for
mcpiroman Nov 25, 2019
8034bb4
Finish comment in pane.h
mcpiroman Nov 25, 2019
14cc2d8
Merge with master 2
mcpiroman Nov 27, 2019
eb67b82
Things that should've gone with merge
mcpiroman Nov 27, 2019
b4febc8
Cleanup & format
mcpiroman Nov 28, 2019
cae3963
More comments
mcpiroman Nov 28, 2019
63ed26a
Review refactor, partly fix border size calculations
mcpiroman Dec 5, 2019
b0097d2
Small PR changes
mcpiroman Dec 11, 2019
cb0186a
Move Pane.LayoutSizeNode.cpp out of lib folder
mcpiroman Dec 11, 2019
bada548
Merge with master 3
mcpiroman Dec 11, 2019
24a88a5
Merge branch 'master' into 2834-snap-to-char-grid
mcpiroman Dec 18, 2019
8cf35e8
Merge branch 'master' into 2834-snap-to-char-grid
mcpiroman Dec 20, 2019
b933528
Github apparently switched files to LF, so revert that
mcpiroman Dec 20, 2019
1ebddfc
Some things that miniksa mentioned in #4068
mcpiroman Jan 4, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/cascadia/TerminalApp/App.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,13 @@ namespace winrt::TerminalApp::implementation
return point;
}

// Method Description:
// - See Pane::SnapDimension
float App::SnapDimension(const bool widthOrHeight, const float dimension) const
{
return _root->SnapDimension(widthOrHeight, dimension);
}

bool App::GetShowTabsInTitlebar()
{
if (!_loadedInitialSettings)
Expand Down
1 change: 1 addition & 0 deletions src/cascadia/TerminalApp/App.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ namespace winrt::TerminalApp::implementation
Windows::Foundation::Point GetLaunchDimensions(uint32_t dpi);
winrt::Windows::Foundation::Point GetLaunchInitialPositions(int32_t defaultInitialX, int32_t defaultInitialY);
LaunchMode GetLaunchMode();
float SnapDimension(const bool widthOrHeight, const float dimension) const;
bool GetShowTabsInTitlebar();

Windows::UI::Xaml::UIElement GetRoot() noexcept;
Expand Down
1 change: 1 addition & 0 deletions src/cascadia/TerminalApp/App.idl
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ namespace TerminalApp
Windows.Foundation.Point GetLaunchDimensions(UInt32 dpi);
Windows.Foundation.Point GetLaunchInitialPositions(Int32 defaultInitialX, Int32 defaultInitialY);
LaunchMode GetLaunchMode();
Single SnapDimension(Boolean widthOrHeight, Single dimension);
Boolean GetShowTabsInTitlebar();
void TitlebarClicked();
void WindowCloseButtonClicked();
Expand Down
433 changes: 394 additions & 39 deletions src/cascadia/TerminalApp/Pane.cpp

Large diffs are not rendered by default.

38 changes: 34 additions & 4 deletions src/cascadia/TerminalApp/Pane.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class Pane : public std::enable_shared_from_this<Pane>
Horizontal = 2
};

Pane(const GUID& profile, const winrt::Microsoft::Terminal::TerminalControl::TermControl& control, const bool lastFocused = false);
Pane(const GUID& profile, const winrt::Microsoft::Terminal::TerminalControl::TermControl& control, Pane* const rootPane, const bool lastFocused = false);
mcpiroman marked this conversation as resolved.
Show resolved Hide resolved

std::shared_ptr<Pane> GetFocusedPane();
winrt::Microsoft::Terminal::TerminalControl::TermControl GetFocusedTerminalControl();
Expand All @@ -51,27 +51,31 @@ class Pane : public std::enable_shared_from_this<Pane>

bool CanSplit(SplitState splitType);
void Split(SplitState splitType, const GUID& profile, const winrt::Microsoft::Terminal::TerminalControl::TermControl& control);
float SnapDimension(const bool widthOrHeight, const float dimension) const;

void Close();

DECLARE_EVENT(Closed, _closedHandlers, winrt::Microsoft::Terminal::TerminalControl::ConnectionClosedEventArgs);

private:
struct LayoutSizeNode;

winrt::Windows::UI::Xaml::Controls::Grid _root{};
winrt::Windows::UI::Xaml::Controls::Grid _separatorRoot{ nullptr };
winrt::Microsoft::Terminal::TerminalControl::TermControl _control{ nullptr };

Pane* _rootPane;
std::shared_ptr<Pane> _firstChild{ nullptr };
std::shared_ptr<Pane> _secondChild{ nullptr };
SplitState _splitState{ SplitState::None };
std::optional<float> _firstPercent{ std::nullopt };
std::optional<float> _secondPercent{ std::nullopt };
float _desiredSplitPosition;

bool _lastFocused{ false };
std::optional<GUID> _profile{ std::nullopt };
winrt::event_token _connectionClosedToken{ 0 };
winrt::event_token _firstClosedToken{ 0 };
winrt::event_token _secondClosedToken{ 0 };
winrt::event_token _fontSizeChangedToken{ 0 };

std::shared_mutex _createCloseLock{};

Expand All @@ -92,10 +96,16 @@ class Pane : public std::enable_shared_from_this<Pane>

void _FocusFirstChild();
void _ControlClosedHandler();
void _FontSizeChangedHandler(const int fontWidth, const int fontHeight, const bool isInitialChange);

std::pair<float, float> _GetPaneSizes(const float& fullSize);
std::pair<float, float> _GetPaneSizes(const float fullSize) const;
std::pair<float, float> _CalcSnappedPaneDimensions(const bool widthOrHeight, const float fullSize, std::pair<float, float>* next) const;
std::pair<float, float> _SnapDimension(const bool widthOrHeight, const float dimension) const;
void _AdvanceSnappedDimension(const bool widthOrHeight, LayoutSizeNode& sizeNode) const;

winrt::Windows::Foundation::Size _GetMinSize() const;
LayoutSizeNode _GetMinSizeTree(const bool widthOrHeight) const;
float _ClampSplitPosition(const bool widthOrHeight, const float requestedValue, const float totalSize) const;

// Function Description:
// - Returns true if the given direction can be used with the given split
Expand Down Expand Up @@ -130,4 +140,24 @@ class Pane : public std::enable_shared_from_this<Pane>
}
return false;
}

// Helper structure that builds a (roughly) binary tree corresponding
// to the pane tree. Used for layouting panes with snapped sizes.
struct LayoutSizeNode
{
float size;
bool isMinimumSize;
std::unique_ptr<LayoutSizeNode> firstChild;
std::unique_ptr<LayoutSizeNode> secondChild;
std::unique_ptr<LayoutSizeNode> nextFirstChild;
mcpiroman marked this conversation as resolved.
Show resolved Hide resolved
std::unique_ptr<LayoutSizeNode> nextSecondChild;

LayoutSizeNode(const float minSize);
LayoutSizeNode(const LayoutSizeNode& other);

LayoutSizeNode& operator=(const LayoutSizeNode& other);

private:
void _AssignChildNode(std::unique_ptr<LayoutSizeNode>& nodeField, const LayoutSizeNode* const newNode);
};
};
9 changes: 8 additions & 1 deletion src/cascadia/TerminalApp/Tab.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ namespace winrt

Tab::Tab(const GUID& profile, const TermControl& control)
{
_rootPane = std::make_shared<Pane>(profile, control, true);
_rootPane = std::make_shared<Pane>(profile, control, nullptr, true);

_rootPane->Closed([=]() {
_closedHandlers();
Expand Down Expand Up @@ -230,6 +230,13 @@ void Tab::SplitPane(Pane::SplitState splitType, const GUID& profile, TermControl
_rootPane->Split(splitType, profile, control);
}

// Method Description:
// - See Pane::SnapDimension
float Tab::SnapDimension(const bool widthOrHeight, const float dimension) const
{
return _rootPane->SnapDimension(widthOrHeight, dimension);
}

// Method Description:
// - Update the size of our panes to fill the new given size. This happens when
// the window is resized.
Expand Down
2 changes: 2 additions & 0 deletions src/cascadia/TerminalApp/Tab.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ class Tab
bool CanSplitPane(Pane::SplitState splitType);
void SplitPane(Pane::SplitState splitType, const GUID& profile, winrt::Microsoft::Terminal::TerminalControl::TermControl& control);

float SnapDimension(const bool widthOrHeight, const float dimension) const;
mcpiroman marked this conversation as resolved.
Show resolved Hide resolved

void UpdateFocus();
void UpdateIcon(const winrt::hstring iconPath);

Expand Down
8 changes: 8 additions & 0 deletions src/cascadia/TerminalApp/TerminalPage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1058,6 +1058,14 @@ namespace winrt::TerminalApp::implementation
}
}

// Method Description:
// - See Pane::SnapDimension
float TerminalPage::SnapDimension(const bool widthOrHeight, const float dimension) const
{
const auto focusedTabIndex = _GetFocusedTabIndex();
return _tabs[focusedTabIndex]->SnapDimension(widthOrHeight, dimension);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note to self: This is probably where I'd implement a setting to disable the snapping. By simply not calling SnamDimension here, and just returning dimension, then the AppHost layer will act as though the proposed snap size was okay, and it'll still smooth resize.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rather than having method named SnapDimension that sometimes doesn't do its job, it might be cleaner just not to call it at all in IslandWindow.

Secondly, that would only disable the 'window' snapping but not 'pane' snapping (so if one splits terminal vertically and changes the window's width, the left pane will still snap, although the whole window would go smoothly). Should it be this way? Maybe make this 3-way setting that would also cover that (like fullSnap, innerSnap, noSnap).

}

// Method Description:
// - Place `copiedData` into the clipboard as text. Triggered when a
// terminal control raises it's CopyToClipboard event.
Expand Down
2 changes: 2 additions & 0 deletions src/cascadia/TerminalApp/TerminalPage.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ namespace winrt::TerminalApp::implementation

void TitlebarClicked();

float SnapDimension(const bool widthOrHeight, const float dimension) const;

void CloseWindow();

// -------------------------------- WinRT Events ---------------------------------
Expand Down
92 changes: 68 additions & 24 deletions src/cascadia/TerminalControl/TermControl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ namespace winrt::Microsoft::Terminal::TerminalControl::implementation
_swapChainPanel{ nullptr },
_settings{ settings },
_closing{ false },
_padding{ 0 },
_scrollBarWidth{ std::nullopt },
_lastScrollOffset{ std::nullopt },
_autoScrollVelocity{ 0 },
_autoScrollingPointerPoint{ std::nullopt },
Expand Down Expand Up @@ -206,21 +208,21 @@ namespace winrt::Microsoft::Terminal::TerminalControl::implementation
uint32_t bg = _settings.DefaultBackground();
_BackgroundColorChanged(bg);

const auto existingPadding = _padding;
_padding = _ParseThicknessFromPadding(_settings.Padding());
// Apply padding as swapChainPanel's margin
auto newMargin = _ParseThicknessFromPadding(_settings.Padding());
auto existingMargin = _swapChainPanel.Margin();
mcpiroman marked this conversation as resolved.
Show resolved Hide resolved
_swapChainPanel.Margin(newMargin);
_swapChainPanel.Margin(_padding);

if (newMargin != existingMargin && newMargin != Thickness{ 0 })
if (_padding != existingPadding && _padding != Thickness{ 0 })
{
TraceLoggingWrite(g_hTerminalControlProvider,
"NonzeroPaddingApplied",
TraceLoggingDescription("An event emitted when a control has padding applied to it"),
TraceLoggingStruct(4, "Padding"),
TraceLoggingFloat64(newMargin.Left, "Left"),
TraceLoggingFloat64(newMargin.Top, "Top"),
TraceLoggingFloat64(newMargin.Right, "Right"),
TraceLoggingFloat64(newMargin.Bottom, "Bottom"),
TraceLoggingFloat64(_padding.Left, "Left"),
TraceLoggingFloat64(_padding.Top, "Top"),
TraceLoggingFloat64(_padding.Right, "Right"),
TraceLoggingFloat64(_padding.Bottom, "Bottom"),
TraceLoggingKeyword(MICROSOFT_KEYWORD_MEASURES),
TelemetryPrivacyDataTag(PDT_ProductAndServicePerformance));
}
Expand Down Expand Up @@ -392,7 +394,7 @@ namespace winrt::Microsoft::Terminal::TerminalControl::implementation

const Windows::UI::Xaml::Thickness TermControl::GetPadding() const
{
return _swapChainPanel.Margin();
return _padding;
}

void TermControl::SwapChainChanged()
Expand Down Expand Up @@ -445,10 +447,17 @@ namespace winrt::Microsoft::Terminal::TerminalControl::implementation
auto dxEngine = std::make_unique<::Microsoft::Console::Render::DxEngine>();
_renderer->AddRenderEngine(dxEngine.get());

// Set up the renderer to be used to calculate the width of a glyph,
// should we be unable to figure out its width another way.
auto pfn = std::bind(&::Microsoft::Console::Render::Renderer::IsGlyphWideByFont, _renderer.get(), std::placeholders::_1);
SetGlyphWidthFallback(pfn);

_scrollBarWidth = gsl::narrow_cast<float>(_scrollBar.ActualWidth());

// Initialize our font with the renderer
// We don't have to care about DPI. We'll get a change message immediately if it's not 96
// and react accordingly.
_UpdateFont();
_UpdateFont(true);

const COORD windowSize{ static_cast<short>(windowWidth), static_cast<short>(windowHeight) };

Expand Down Expand Up @@ -800,8 +809,8 @@ namespace winrt::Microsoft::Terminal::TerminalControl::implementation
const auto cursorPosition = point.Position();
_SetEndSelectionPointAtCursor(cursorPosition);

const double cursorBelowBottomDist = cursorPosition.Y - _swapChainPanel.Margin().Top - _swapChainPanel.ActualHeight();
const double cursorAboveTopDist = -1 * cursorPosition.Y + _swapChainPanel.Margin().Top;
const double cursorBelowBottomDist = cursorPosition.Y - _padding.Top - _swapChainPanel.ActualHeight();
mcpiroman marked this conversation as resolved.
Show resolved Hide resolved
const double cursorAboveTopDist = -1 * cursorPosition.Y + _padding.Top;

constexpr double MinAutoScrollDist = 2.0; // Arbitrary value
double newAutoScrollVelocity = 0.0;
Expand Down Expand Up @@ -1211,15 +1220,23 @@ namespace winrt::Microsoft::Terminal::TerminalControl::implementation
// font change. This method will *not* change the buffer/viewport size
// to account for the new glyph dimensions. Callers should make sure to
// appropriately call _DoResize after this method is called.
void TermControl::_UpdateFont()
// Arguments:
// - initialUpdate: whether this font update should be considered as being
// concerned with initialization process. Value forwarded to event handler.
void TermControl::_UpdateFont(const bool initialUpdate)
{
auto lock = _terminal->LockForWriting();
{
auto lock = _terminal->LockForWriting();

const int newDpi = static_cast<int>(static_cast<double>(USER_DEFAULT_SCREEN_DPI) * _swapChainPanel.CompositionScaleX());
const int newDpi = static_cast<int>(static_cast<double>(USER_DEFAULT_SCREEN_DPI) * _swapChainPanel.CompositionScaleX());

// TODO: MSFT:20895307 If the font doesn't exist, this doesn't
// actually fail. We need a way to gracefully fallback.
_renderer->TriggerFontChange(newDpi, _desiredFont, _actualFont);
// TODO: MSFT:20895307 If the font doesn't exist, this doesn't
// actually fail. We need a way to gracefully fallback.
_renderer->TriggerFontChange(newDpi, _desiredFont, _actualFont);
}

const auto fontSize = _actualFont.GetSize();
_fontSizeChangedHandlers(fontSize.X, fontSize.Y, initialUpdate);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we just check initialUpdate here, and only raise the event when it's true? It looks like it's only actually doing something in Pane when it's true.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I did this because in future we may re-layout panes even on other events, like font/zoom change and so we don't make to much diff (see issue #xxx I haven't filled one yet). But it might be too future of a future to bother now.

}

// Method Description:
Expand Down Expand Up @@ -1632,17 +1649,43 @@ namespace winrt::Microsoft::Terminal::TerminalControl::implementation
// Reserve additional space if scrollbar is intended to be visible
if (_settings.ScrollState() == ScrollbarState::Visible)
{
width += _scrollBar.ActualWidth();
width += _scrollBarWidth.value_or(0);
}

// Account for the size of any padding
auto thickness = _ParseThicknessFromPadding(_settings.Padding());
width += thickness.Left + thickness.Right;
height += thickness.Top + thickness.Bottom;
width += _padding.Left + _padding.Right;
height += _padding.Top + _padding.Bottom;

return { gsl::narrow_cast<float>(width), gsl::narrow_cast<float>(height) };
}

// Method Description:
// - Adjusts given dimension (width or height) so that it aligns to the character grid.
// The snap is always downward.
// Arguments:
// - widthOrHeight: if true operates on width, otherwise on height
// - dimension: a dimension (width or height) to be snapped
// Return Value:
// - A dimension that would be aligned to the character grid.
float TermControl::SnapDimensionToGrid(const bool widthOrHeight, const float dimension) const
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reading this method, I'd maybe want this first param named something like

Suggested change
float TermControl::SnapDimensionToGrid(const bool widthOrHeight, const float dimension) const
float TermControl::SnapDimensionToGrid(const bool snapToWidth, const float dimension) const

instead, especially lower:

if (snapToWidth && _settings.ScrollState() == ScrollbarState::Visible)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If so, this should be renamed everywhere (so in a lot of places). I went with widthOrHeight because I find it more readable. With some thing like isWidth, it is not so apparent what it means if it's false. Usually not-width means height, but not always.

{
const auto fontSize = _actualFont.GetSize();
const auto fontDimension = widthOrHeight ? fontSize.X : fontSize.Y;

auto nonTerminalArea = gsl::narrow_cast<float>(widthOrHeight ?
_padding.Left + _padding.Right :
_padding.Top + _padding.Bottom);

if (widthOrHeight && _settings.ScrollState() == ScrollbarState::Visible)
{
nonTerminalArea += _scrollBarWidth.value_or(0);
}

const auto gridSize = dimension - nonTerminalArea;
const int cells = static_cast<int>(gridSize / fontDimension);
return cells * fontDimension + nonTerminalArea;
}

// Method Description:
// - Create XAML Thickness object based on padding props provided.
// Used for controlling the TermControl XAML Grid container's Padding prop.
Expand Down Expand Up @@ -1771,8 +1814,8 @@ namespace winrt::Microsoft::Terminal::TerminalControl::implementation
{
// Exclude padding from cursor position calculation
COORD terminalPosition = {
static_cast<SHORT>(cursorPosition.X - _swapChainPanel.Margin().Left),
static_cast<SHORT>(cursorPosition.Y - _swapChainPanel.Margin().Top)
static_cast<SHORT>(cursorPosition.X - _padding.Left),
static_cast<SHORT>(cursorPosition.Y - _padding.Top)
};

const auto fontSize = _actualFont.GetSize();
Expand Down Expand Up @@ -1830,6 +1873,7 @@ namespace winrt::Microsoft::Terminal::TerminalControl::implementation
// Winrt events need a method for adding a callback to the event and removing the callback.
// These macros will define them both for you.
DEFINE_EVENT(TermControl, TitleChanged, _titleChangedHandlers, TerminalControl::TitleChangedEventArgs);
DEFINE_EVENT(TermControl, FontSizeChanged, _fontSizeChangedHandlers, TerminalControl::FontSizeChangedEventArgs);
DEFINE_EVENT(TermControl, ConnectionClosed, _connectionClosedHandlers, TerminalControl::ConnectionClosedEventArgs);
DEFINE_EVENT(TermControl, ScrollPositionChanged, _scrollPositionChangedHandlers, TerminalControl::ScrollPositionChangedEventArgs);

Expand Down
8 changes: 7 additions & 1 deletion src/cascadia/TerminalControl/TermControl.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ namespace winrt::Microsoft::Terminal::TerminalControl::implementation
bool ShouldCloseOnExit() const noexcept;
Windows::Foundation::Size CharacterDimensions() const;
Windows::Foundation::Size MinimumSize() const;
float SnapDimensionToGrid(const bool widthOrHeight, const float dimension) const;

void ScrollViewport(int viewTop);
void KeyboardScrollViewport(int viewTop);
Expand All @@ -83,6 +84,7 @@ namespace winrt::Microsoft::Terminal::TerminalControl::implementation
// clang-format off
// -------------------------------- WinRT Events ---------------------------------
DECLARE_EVENT(TitleChanged, _titleChangedHandlers, TerminalControl::TitleChangedEventArgs);
DECLARE_EVENT(FontSizeChanged, _fontSizeChangedHandlers, TerminalControl::FontSizeChangedEventArgs);
DECLARE_EVENT(ConnectionClosed, _connectionClosedHandlers, TerminalControl::ConnectionClosedEventArgs);
DECLARE_EVENT(ScrollPositionChanged, _scrollPositionChangedHandlers, TerminalControl::ScrollPositionChangedEventArgs);

Expand Down Expand Up @@ -111,6 +113,10 @@ namespace winrt::Microsoft::Terminal::TerminalControl::implementation

FontInfoDesired _desiredFont;
FontInfo _actualFont;
Windows::UI::Xaml::Thickness _padding;
mcpiroman marked this conversation as resolved.
Show resolved Hide resolved

// Cached since _scrollBar.ActualWidth() became bottle-neck when resizing
mcpiroman marked this conversation as resolved.
Show resolved Hide resolved
std::optional<float> _scrollBarWidth;

std::optional<int> _lastScrollOffset;

Expand Down Expand Up @@ -151,7 +157,7 @@ namespace winrt::Microsoft::Terminal::TerminalControl::implementation
void _InitializeBackgroundBrush();
void _BackgroundColorChanged(const uint32_t color);
bool _InitializeTerminal();
void _UpdateFont();
void _UpdateFont(const bool initialUpdate = false);
void _KeyDownHandler(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::Input::KeyRoutedEventArgs const& e);
void _CharacterHandler(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::Input::CharacterReceivedRoutedEventArgs const& e);
void _PointerPressedHandler(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::Input::PointerRoutedEventArgs const& e);
Expand Down
Loading