Skip to content

Commit

Permalink
Fix setting launch position in the Settings UI not working (#14518)
Browse files Browse the repository at this point in the history
## Summary of the Pull Request
This change should have been a part of #14190 but was missed. 

## PR Checklist
* [x] Closes #14469 
* [x] CLA signed. If not, go over [here](https://cla.opensource.microsoft.com/microsoft/Terminal) and sign the CLA
* [ ] Tests added/passed
* [ ] Documentation updated. If checked, please file a pull request on [our docs repo](https://github.com/MicrosoftDocs/terminal) and link it here: #xxx
* [ ] Schema updated.
* [x] I've discussed this with core contributors already. If not checked, I'm ready to accept this work might be rejected in favor of a different grand plan. Issue number where discussion took place: #xxx

## Validation Steps Performed
Setting launch position in the settings UI works now
  • Loading branch information
PankajBhojwani committed Dec 9, 2022
1 parent 79c47f6 commit b9c3b5c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/cascadia/TerminalSettingsEditor/LaunchViewModel.cpp
Expand Up @@ -68,7 +68,7 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
const auto x = _Settings.GlobalSettings().InitialPosition().X;
// If there's no value here, return NAN - XAML will ignore it and
// put the placeholder text in the box instead
const auto xCoord = x.try_as<int64_t>();
const auto xCoord = x.try_as<int32_t>();
return xCoord.has_value() ? gsl::narrow_cast<double>(xCoord.value()) : NAN;
}

Expand All @@ -77,7 +77,7 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
const auto y = _Settings.GlobalSettings().InitialPosition().Y;
// If there's no value here, return NAN - XAML will ignore it and
// put the placeholder text in the box instead
const auto yCoord = y.try_as<int64_t>();
const auto yCoord = y.try_as<int32_t>();
return yCoord.has_value() ? gsl::narrow_cast<double>(yCoord.value()) : NAN;
}

Expand Down

0 comments on commit b9c3b5c

Please sign in to comment.