oh no the DPI scaling doesn't work for this at all
This commit is contained in:
parent
25de1a2940
commit
eded53abe1
|
@ -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);
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue