68 {
69 if (during_synthesized_reset_) {
70 during_synthesized_reset_ = current != DIRECTMANIPULATION_READY;
71 return S_OK;
72 }
73 during_inertia_ = current == DIRECTMANIPULATION_INERTIA;
74 if (current == DIRECTMANIPULATION_RUNNING) {
75 IDirectManipulationContent*
content;
76 HRESULT hr = viewport->GetPrimaryContent(IID_PPV_ARGS(&
content));
81 initial_gesture_data_ = ConvertToGestureData(
transform);
82 } else {
83 FML_LOG(ERROR) <<
"GetContentTransform failed";
84 }
85 } else {
86 FML_LOG(ERROR) <<
"GetPrimaryContent failed";
87 }
90 }
91 } else if (previous == DIRECTMANIPULATION_RUNNING) {
92
93 last_pan_delta_x_ = 0.0;
94 last_pan_delta_y_ = 0.0;
97 }
98 } else if (previous == DIRECTMANIPULATION_INERTIA) {
100 (std::max)(std::abs(last_pan_delta_x_), std::abs(last_pan_delta_y_)) >
101 0.01) {
103 }
104
105
106
107
108 during_synthesized_reset_ = true;
109 last_pan_x_ = 0.0;
110 last_pan_y_ = 0.0;
111 last_pan_delta_x_ = 0.0;
112 last_pan_delta_y_ = 0.0;
113 RECT rect;
114 HRESULT hr = viewport->GetViewportRect(&rect);
116 FML_LOG(ERROR) <<
"Failed to get the current viewport rect";
117 return E_FAIL;
118 }
119 hr = viewport->ZoomToRect(rect.left, rect.top, rect.right, rect.bottom,
120 false);
122 FML_LOG(ERROR) <<
"Failed to reset the gesture using ZoomToRect";
123 return E_FAIL;
124 }
125 }
126 return S_OK;
127}
virtual void OnPointerPanZoomStart(int32_t device_id)=0
virtual void OnPointerPanZoomEnd(int32_t device_id)=0
virtual void OnScrollInertiaCancel(int32_t device_id)=0