2424
2525namespace flutter {
2626
27+ int32_t DirectManipulationEventHandler::GetDeviceId () {
28+ return (int32_t ) reinterpret_cast <int64_t >(this );
29+ }
30+
2731STDMETHODIMP DirectManipulationEventHandler::QueryInterface (REFIID iid,
2832 void ** ppv) {
2933 if ((iid == IID_IUnknown) ||
@@ -50,8 +54,7 @@ HRESULT DirectManipulationEventHandler::OnViewportStatusChanged(
5054 if (!during_synthesized_reset_) {
5155 // Not a false event.
5256 if (owner_->binding_handler_delegate ) {
53- owner_->binding_handler_delegate ->OnPointerPanZoomStart (
54- (int32_t ) reinterpret_cast <int64_t >(this ));
57+ owner_->binding_handler_delegate ->OnPointerPanZoomStart (GetDeviceId ());
5558 }
5659 }
5760 }
@@ -60,12 +63,11 @@ HRESULT DirectManipulationEventHandler::OnViewportStatusChanged(
6063 last_pan_delta_x_ = 0.0 ;
6164 last_pan_delta_y_ = 0.0 ;
6265 if (owner_->binding_handler_delegate ) {
63- owner_->binding_handler_delegate ->OnPointerPanZoomEnd (
64- (int32_t ) reinterpret_cast <int64_t >(this ));
66+ owner_->binding_handler_delegate ->OnPointerPanZoomEnd (GetDeviceId ());
6567 }
6668 } else if (previous == DIRECTMANIPULATION_INERTIA) {
6769 if (owner_->binding_handler_delegate && std::max (std::abs (last_pan_delta_x_), std::abs (last_pan_delta_y_)) > 0.01 ) {
68- owner_->binding_handler_delegate ->OnScrollInertiaCancel (( int32_t ) reinterpret_cast < int64_t >( this ));
70+ owner_->binding_handler_delegate ->OnScrollInertiaCancel (GetDeviceId ( ));
6971 }
7072 // Need to reset the content transform to its original position
7173 // so that we are ready for the next gesture.
@@ -123,7 +125,7 @@ HRESULT DirectManipulationEventHandler::OnContentUpdated(
123125 last_pan_y_ = pan_y;
124126 if (owner_->binding_handler_delegate && !during_inertia_) {
125127 owner_->binding_handler_delegate ->OnPointerPanZoomUpdate (
126- ( int32_t ) reinterpret_cast < int64_t >( this ), pan_x, pan_y, scale, 0 );
128+ GetDeviceId ( ), pan_x, pan_y, scale, 0 );
127129 }
128130 }
129131 return S_OK;
0 commit comments