Skip to content

Commit

Permalink
Fix crash in RefreshVisualizer when not wrapping a ScrollViewer (#1328)
Browse files Browse the repository at this point in the history
  • Loading branch information
jevansaks committed Sep 17, 2019
1 parent 67537d9 commit c007095
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion dev/PullToRefresh/RefreshVisualizer/RefreshVisualizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,13 @@ void RefreshVisualizer::UpdateContent()
contentVisual.Opacity(1.0f);
if (m_root)
{
float translationRatio = (1.0f - (float)(m_refreshInfoProvider.get().ExecutionRatio())) * PARALLAX_POSITION_RATIO;
float translationRatio = [this]() {
if (auto&& refreshInfoProvider = m_refreshInfoProvider.get())
{
return (1.0f - (float)(refreshInfoProvider.ExecutionRatio())) * PARALLAX_POSITION_RATIO;
}
return 1.0f;
}();
translationRatio = IsPullDirectionFar() ? -1.0f * translationRatio : translationRatio;
//On RS2 and above we achieve the parallax animation using the Translation property, so we set the appropriate field here.
if (SharedHelpers::IsRS2OrHigher())
Expand Down

0 comments on commit c007095

Please sign in to comment.