Closed timheuer closed 12 years ago
Could you explain in a little more detail what you mean by this?
Actually I can't recall now...a user reported it...
The tilt effect is not reset when pushing the control on which the effect is applied and then swiping your finger e.g. left or right. I have this situation on the main screen of my app which basically contains a couple of 'tiles' with the tilt effect applied on them. The main screen can be swiped left and right. When swiping left or right the tilt effect starts correctly on the tile being hit but when you lift your finger after the swipe, the effect stays applied and is not reset.
The reason for this is that the current code only takes into account a regular push and hence only resets the tilt effect in the TiltEffectPointerReleased method:
/// <summary>
/// Event handler for ManipulationCompleted.
/// </summary>
/// <param name="sender">sender of the event - this will be the tilting
/// object (eg a button).</param>
/// <param name="e">Event arguments.</param>
private static void TiltEffectPointerReleased(object sender, PointerRoutedEventArgs e)
{
EndTiltEffect(_currentTiltElement);
}
By adding the following code pushing and 'leaving' the pushed control also ends the tilt effect:
/// <summary>
/// Event handler for PointerCaptureLost
/// </summary>
/// <param name="sender">sender of the event - this will be the tilting
/// object (eg a button).</param>
/// <param name="e">Event arguments.</param>
private static void TiltEffectPointerCaptureLost(object sender, PointerRoutedEventArgs e)
{
EndTiltEffect(_currentTiltElement);
}
This fix looks good to me. I'll make a pull request...
The animation should reset every time you press on it so it appears responsive. Now it just stays in the same state.