edge: fix to use values one unit smaller than width/height when evaluating the event... 13/318113/1
authorduna.oh <duna.oh@samsung.com>
Mon, 13 Jan 2025 07:18:18 +0000 (16:18 +0900)
committerduna.oh <duna.oh@samsung.com>
Mon, 13 Jan 2025 07:18:18 +0000 (16:18 +0900)
Change-Id: I94e6627941118747b08a2adae5fffe1c7de7a5ad

src/e_mod_gesture_events.c

index 957769a5749667f196b51a794f24cd04530b91c4..67d379feb5a6f6dffd0cbe06f917ea9312eb817f 100644 (file)
@@ -547,7 +547,7 @@ _e_gesture_process_edge_swipe_down(Ecore_Event_Mouse_Button *ev)
 
    if (gesture->gesture_events.num_pressed == 1)
      {
-        int comp_w = 0, comp_h = 0;
+        int comp_w = 0, comp_h = 0, max_x_pos, max_y_pos;
         for (i = 1; i < E_GESTURE_FINGER_MAX+1; i++)
           {
              if (edge_swipes->base.fingers[i].enabled)
@@ -557,13 +557,15 @@ _e_gesture_process_edge_swipe_down(Ecore_Event_Mouse_Button *ev)
           }
 
         e_comp_size_get(&comp_w, &comp_h);
+        max_x_pos = comp_w - 1;
+        max_y_pos = comp_h - 1;
         if (ev->y < conf->edge_swipe.area_offset)
           edge_swipes->base.edge = E_GESTURE_EDGE_TOP;
-        else if (ev->y > comp_h - conf->edge_swipe.area_offset)
+        else if (ev->y > max_y_pos - conf->edge_swipe.area_offset)
           edge_swipes->base.edge = E_GESTURE_EDGE_BOTTOM;
         else if (ev->x < conf->edge_swipe.area_offset)
           edge_swipes->base.edge = E_GESTURE_EDGE_LEFT;
-        else if (ev->x > comp_w - conf->edge_swipe.area_offset)
+        else if (ev->x > max_x_pos - conf->edge_swipe.area_offset)
           edge_swipes->base.edge = E_GESTURE_EDGE_RIGHT;
 
         if (!((1 << (edge_swipes->base.edge)) & edge_swipes->base.enabled_edge))
@@ -802,7 +804,7 @@ _e_gesture_process_edge_drag_down(Ecore_Event_Mouse_Button *ev)
 
    if (gesture->gesture_events.num_pressed == 1)
      {
-        int comp_w = 0, comp_h = 0;
+        int comp_w = 0, comp_h = 0, max_x_pos, max_y_pos;
 
         for (i = 1; i < E_GESTURE_FINGER_MAX+1; i++)
           {
@@ -813,13 +815,15 @@ _e_gesture_process_edge_drag_down(Ecore_Event_Mouse_Button *ev)
           }
 
         e_comp_size_get(&comp_w, &comp_h);
+        max_x_pos = comp_w - 1;
+        max_y_pos = comp_h - 1;
         if (ev->y < conf->edge_drag.area_offset)
           edge_drags->base.edge = E_GESTURE_EDGE_TOP;
-        else if (ev->y > comp_h - conf->edge_drag.area_offset)
+        else if (ev->y > max_y_pos - conf->edge_drag.area_offset)
           edge_drags->base.edge = E_GESTURE_EDGE_BOTTOM;
         else if (ev->x < conf->edge_drag.area_offset)
           edge_drags->base.edge = E_GESTURE_EDGE_LEFT;
-        else if (ev->x > comp_w - conf->edge_drag.area_offset)
+        else if (ev->x > max_x_pos - conf->edge_drag.area_offset)
           edge_drags->base.edge = E_GESTURE_EDGE_RIGHT;
 
         if (!((1 << (edge_drags->base.edge)) & edge_drags->base.enabled_edge))