e_comp_wl: fix rounding error using lround() in e_comp_wl_map_inv_coord_get() 77/270177/1
authorDuna Oh <duna.oh@samsung.com>
Tue, 25 Jan 2022 08:00:46 +0000 (17:00 +0900)
committerDoyoun Kang <doyoun.kang@samsung.com>
Wed, 26 Jan 2022 07:39:53 +0000 (16:39 +0900)
E20 converts the client-area coordinates to the screen coordinates
using e_comp_wl_map_inv_coords_get(). When trying to get new coordinates,
there was issues with rounding error. Fix it using lround()

Change-Id: I6be25998287ad0dc869eb60af8474ba2b2a7a77e

src/bin/e_comp_wl.c

index d2185a0c3eb8992cf439a451883b9dbe8ab2fff4..b77c95e3f3957340b3490eb74178d4081fee6a10 100644 (file)
@@ -552,8 +552,8 @@ e_comp_wl_map_inv_coord_get(E_Client *ec, int x, int y, int *mx, int *my)
      }
    e_map_coords_get(map2, (double)x, (double)y, &inv_x, &inv_y, 0);
 
-   *mx = (int)inv_x;
-   *my = (int)inv_y;
+   *mx = lround(inv_x);
+   *my = lround(inv_y);
 
    e_map_free(map);
    e_map_free(map2);