oh no the DPI scaling doesn't work for this at all

This commit is contained in:
Mike Griese 2019-08-10 18:00:01 -05:00
parent 25de1a2940
commit eded53abe1
2 changed files with 16 additions and 1 deletions

View file

@ -752,7 +752,6 @@ void Pane::_CreateSplitContent()
_separatorRoot.Background(brush);
_separatorRoot.ManipulationStarted([this](auto&&, auto& args) {
auto pos = args.Position();
pos;
@ -767,6 +766,21 @@ void Pane::_CreateSplitContent()
auto offset = transform.TransformPoint({ 0, 0 });
auto delta = args.Delta();
auto deltaTrans = delta.Translation;
// Turn the delta into a percentage
const Size actualSize{ gsl::narrow_cast<float>(_root.ActualWidth()),
gsl::narrow_cast<float>(_root.ActualHeight()) };
const bool changeWidth = _splitState == SplitState::Vertical;
auto actualDimension = changeWidth ? actualSize.Width : actualSize.Height;
actualDimension -= PaneSeparatorSize;
auto deltaPercent = deltaTrans.X / actualDimension;
_firstPercent = _firstPercent.value() + deltaPercent;
_secondPercent = 1.0f - _firstPercent.value();
// Resize our columns to match the new percentages.
ResizeContent(actualSize);
// auto trans = transform.try_as<Media::TranslateTransform>();
// auto transform = winrt::Windows::UI::Xaml::TransformToVisual(_root);
// auto rel = inverse.TransformPoint(posCopy);

View file

@ -97,6 +97,7 @@ private:
winrt::Windows::Foundation::Size _GetMinSize() const;
winrt::Windows::Foundation::Point cumulative{ 0, 0 };
float _overDrag = 0;
// Function Description:
// - Returns true if the given direction can be used with the given split