@@ -296,22 +296,23 @@ void Platform::process_input_event(const SDL_Event &event) {
296296}
297297
298298int Platform::find_touch_slot (int id){
299- for (int i = 0 ; i < MAX_FINGERS; i++){
300- if (touch_slots[i] == id)return i;
299+ for (int i = 0 ; i < MAX_FINGERS; i++) {
300+ if (touch_slots[i] == id)
301+ return i;
301302 }
302303 return -1 ;
303304}
304305
305306void Platform::push_slot (std::vector<input::Event> &touch_events, int slot){
306- if (last_slot != slot){
307+ if (last_slot != slot) {
307308 touch_events.push_back ({EV_ABS, ABS_MT_SLOT, slot});
308309 last_slot = slot;
309310 }
310311}
311312
312313void Platform::push_finger_down (int x, int y, int finger_id, std::vector<input::Event> &touch_events){
313314 int slot = find_touch_slot (-1 );
314- if (slot == -1 ){
315+ if (slot == -1 ) {
315316 DEBUG (" no free slot!" );
316317 return ;
317318 }
@@ -325,7 +326,8 @@ void Platform::push_finger_down(int x, int y, int finger_id, std::vector<input::
325326
326327void Platform::push_finger_up (int finger_id, std::vector<input::Event> &touch_events){
327328 int slot = find_touch_slot (finger_id);
328- if (slot == -1 )return ;
329+ if (slot == -1 )
330+ return ;
329331 push_slot (touch_events, slot);
330332 touch_events.push_back ({EV_ABS, ABS_MT_TRACKING_ID, -1 });
331333 touch_events.push_back ({EV_SYN, SYN_REPORT, 0 });
@@ -334,7 +336,8 @@ void Platform::push_finger_up(int finger_id, std::vector<input::Event> &touch_ev
334336
335337void Platform::push_finger_motion (int x, int y, int finger_id, std::vector<input::Event> &touch_events){
336338 int slot = find_touch_slot (finger_id);
337- if (slot == -1 )return ;
339+ if (slot == -1 )
340+ return ;
338341 push_slot (touch_events, slot);
339342 touch_events.push_back ({EV_ABS, ABS_MT_POSITION_X, x});
340343 touch_events.push_back ({EV_ABS, ABS_MT_POSITION_Y, y});
0 commit comments