Skip to content

Commit

Permalink
Follow up to: #2191 Switch ColorPicker to use tracker_ref (#2225)
Browse files Browse the repository at this point in the history
* update tracker ref use

* tab--
  • Loading branch information
kmahone authored Apr 4, 2020
1 parent b1878e2 commit b62ab97
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 20 deletions.
10 changes: 5 additions & 5 deletions dev/ColorPicker/ColorPicker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -957,7 +957,7 @@ void ColorPicker::OnHexTextChanging(winrt::TextBox const& /*sender*/, winrt::Tex
return;
}

auto hexTextBox = m_hexTextBox.get();
auto&& hexTextBox = m_hexTextBox.get();

// If the user hasn't entered a #, we'll do that for them, keeping the cursor
// where it was before.
Expand Down Expand Up @@ -1028,8 +1028,8 @@ void ColorPicker::UpdateThirdDimensionSlider()
return;
}

auto thirdDimensionSlider = m_thirdDimensionSlider.get();
auto thirdDimensionSliderGradientBrush = m_thirdDimensionSliderGradientBrush.get();
auto&& thirdDimensionSlider = m_thirdDimensionSlider.get();
auto&& thirdDimensionSliderGradientBrush = m_thirdDimensionSliderGradientBrush.get();

// Since the slider changes only one color dimension, we can use a LinearGradientBrush
// for its background instead of needing to manually set pixels ourselves.
Expand Down Expand Up @@ -1161,8 +1161,8 @@ void ColorPicker::UpdateAlphaSlider()
return;
}

auto alphaSlider = m_alphaSlider.get();
auto alphaSliderGradientBrush = m_alphaSliderGradientBrush.get();
auto&& alphaSlider = m_alphaSlider.get();
auto&& alphaSliderGradientBrush = m_alphaSliderGradientBrush.get();

// Since the slider changes only one color dimension, we can use a LinearGradientBrush
// for its background instead of needing to manually set pixels ourselves.
Expand Down
31 changes: 16 additions & 15 deletions dev/ColorPicker/ColorSpectrum.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ winrt::Rect ColorSpectrum::GetBoundingRectangle()
{
winrt::Rect localRect{ 0, 0, 0, 0 };

if (auto inputTarget = m_inputTarget.get())
if (auto&& inputTarget = m_inputTarget.get())
{
localRect.Width = static_cast<float>(inputTarget.ActualWidth());
localRect.Height = static_cast<float>(inputTarget.ActualHeight());
Expand Down Expand Up @@ -574,7 +574,8 @@ void ColorSpectrum::UpdateColorFromPoint(const winrt::PointerPoint& point)

void ColorSpectrum::UpdateEllipse()
{
auto selectionEllipsePanel = m_selectionEllipsePanel.get();
auto&& selectionEllipsePanel = m_selectionEllipsePanel.get();

if (!selectionEllipsePanel)
{
return;
Expand Down Expand Up @@ -746,7 +747,7 @@ void ColorSpectrum::UpdateEllipse()
// We only want to bother with the color name tool tip if we can provide color names.
if (DownlevelHelper::ToDisplayNameExists())
{
if (auto colorNameToolTip = m_colorNameToolTip.get())
if (auto&& colorNameToolTip = m_colorNameToolTip.get())
{
// ToolTip doesn't currently provide any way to re-run its placement logic if its placement target moves,
// so toggling IsEnabled induces it to do that without incurring any visual glitches.
Expand Down Expand Up @@ -781,7 +782,7 @@ void ColorSpectrum::OnInputTargetPointerExited(winrt::IInspectable const& /*send

void ColorSpectrum::OnInputTargetPointerPressed(winrt::IInspectable const& /*sender*/, winrt::PointerRoutedEventArgs const& args)
{
auto inputTarget = m_inputTarget.get();
auto&& inputTarget = m_inputTarget.get();

Focus(winrt::FocusState::Pointer);

Expand Down Expand Up @@ -828,13 +829,13 @@ void ColorSpectrum::OnSelectionEllipseFlowDirectionChanged(winrt::DependencyObje

void ColorSpectrum::CreateBitmapsAndColorMap()
{
auto layoutRoot = m_layoutRoot.get();
auto sizingGrid = m_sizingGrid.get();
auto inputTarget = m_inputTarget.get();
auto spectrumRectangle = m_spectrumRectangle.get();
auto spectrumEllipse = m_spectrumEllipse.get();
auto spectrumOverlayRectangle = m_spectrumOverlayRectangle.get();
auto spectrumOverlayEllipse = m_spectrumOverlayEllipse.get();
auto&& layoutRoot = m_layoutRoot.get();
auto&& sizingGrid = m_sizingGrid.get();
auto&& inputTarget = m_inputTarget.get();
auto&& spectrumRectangle = m_spectrumRectangle.get();
auto&& spectrumEllipse = m_spectrumEllipse.get();
auto&& spectrumOverlayRectangle = m_spectrumOverlayRectangle.get();
auto&& spectrumOverlayEllipse = m_spectrumOverlayEllipse.get();

if (!m_layoutRoot ||
!m_sizingGrid ||
Expand Down Expand Up @@ -1435,17 +1436,17 @@ void ColorSpectrum::FillPixelForRing(

void ColorSpectrum::UpdateBitmapSources()
{
auto spectrumOverlayRectangle = m_spectrumOverlayRectangle.get();
auto spectrumOverlayEllipse = m_spectrumOverlayEllipse.get();
auto&& spectrumOverlayRectangle = m_spectrumOverlayRectangle.get();
auto&& spectrumOverlayEllipse = m_spectrumOverlayEllipse.get();

if (!spectrumOverlayRectangle ||
!spectrumOverlayEllipse)
{
return;
}

auto spectrumRectangle = m_spectrumRectangle.get();
auto spectrumEllipse = m_spectrumEllipse.get();
auto&& spectrumRectangle = m_spectrumRectangle.get();
auto&& spectrumEllipse = m_spectrumEllipse.get();

winrt::float4 hsvColor = HsvColor();
winrt::ColorSpectrumComponents components = Components();
Expand Down

0 comments on commit b62ab97

Please sign in to comment.