Skip to content

Commit

Permalink
This doesn't seem to work either.
Browse files Browse the repository at this point in the history
  I tried adding the pane seperators to the Pane::_GetMinWidth calculation. That
  works for prevent the crash, but the resizing is wonky now. If you add a
  Vertical split, then a second, then resize the middle pane really small,
  you'll see that the _last_ resize doesn't work properly. The text seems to
  overhand into the border.

  Additionally, there's really weird behavior resizing panes to be small. They
  don't always seem to be resizable to the smallest size.
  • Loading branch information
zadjii-msft committed Oct 28, 2019
1 parent fa244e2 commit 2fd8323
Showing 1 changed file with 26 additions and 6 deletions.
32 changes: 26 additions & 6 deletions src/cascadia/TerminalApp/Pane.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,14 +133,16 @@ bool Pane::_Resize(const Direction& direction)
// actualDimension is the size in DIPs of this pane in the direction we're
// resizing.
auto actualDimension = changeWidth ? actualSize.Width : actualSize.Height;
actualDimension -= CombinedPaneBorderSize;
// actualDimension -= CombinedPaneBorderSize;

const auto firstMinSize = _firstChild->_GetMinSize();
const auto secondMinSize = _secondChild->_GetMinSize();

// These are the minimum amount of space we need for each of our children
const auto firstMinDimension = (changeWidth ? firstMinSize.Width : firstMinSize.Height) + PaneBorderSize;
const auto secondMinDimension = (changeWidth ? secondMinSize.Width : secondMinSize.Height) + PaneBorderSize;
// const auto firstMinDimension = (changeWidth ? firstMinSize.Width : firstMinSize.Height) + PaneBorderSize;
// const auto secondMinDimension = (changeWidth ? secondMinSize.Width : secondMinSize.Height) + PaneBorderSize;
const auto firstMinDimension = changeWidth ? firstMinSize.Width : firstMinSize.Height;
const auto secondMinDimension = changeWidth ? secondMinSize.Width : secondMinSize.Height;

const auto firstMinPercent = firstMinDimension / actualDimension;
const auto secondMinPercent = secondMinDimension / actualDimension;
Expand Down Expand Up @@ -1029,13 +1031,31 @@ Size Pane::_GetMinSize() const
{
if (_IsLeaf())
{
return _control.MinimumSize();
// return _control.MinimumSize();
///////////////
auto controlSize = _control.MinimumSize();
auto newWidth = controlSize.Width;
auto newHeight = controlSize.Height;

newWidth += WI_IsFlagSet(_borders, Borders::Left) ? PaneBorderSize : 0;
newWidth += WI_IsFlagSet(_borders, Borders::Right) ? PaneBorderSize : 0;

newHeight += WI_IsFlagSet(_borders, Borders::Top) ? PaneBorderSize : 0;
newHeight += WI_IsFlagSet(_borders, Borders::Bottom) ? PaneBorderSize : 0;
return { newWidth, newHeight };
}

const auto firstSize = _firstChild->_GetMinSize();
const auto secondSize = _secondChild->_GetMinSize();
const auto newWidth = firstSize.Width + secondSize.Width + (_splitState == SplitState::Vertical ? CombinedPaneBorderSize : 0);
const auto newHeight = firstSize.Height + secondSize.Height + (_splitState == SplitState::Horizontal ? CombinedPaneBorderSize : 0);
// const auto newWidth = firstSize.Width + secondSize.Width + (_splitState == SplitState::Vertical ? CombinedPaneBorderSize : 0);
// const auto newHeight = firstSize.Height + secondSize.Height + (_splitState == SplitState::Horizontal ? CombinedPaneBorderSize : 0);
auto newWidth = firstSize.Width + secondSize.Width;
// newWidth += WI_IsFlagSet(_borders, Borders::Left) ? PaneBorderSize : 0;
// newWidth += WI_IsFlagSet(_borders, Borders::Right) ? PaneBorderSize : 0;
auto newHeight = firstSize.Height + secondSize.Height;
// newHeight += WI_IsFlagSet(_borders, Borders::Top) ? PaneBorderSize : 0;
// newHeight += WI_IsFlagSet(_borders, Borders::Bottom) ? PaneBorderSize : 0;

return { newWidth, newHeight };
}

Expand Down

0 comments on commit 2fd8323

Please sign in to comment.