Add remained pixels to grids which are end of right and bottom 04/281604/1
authorSuyeon Hwang <stom.hwang@samsung.com>
Mon, 19 Sep 2022 05:06:33 +0000 (14:06 +0900)
committerTizen AI <ai.tzn.sec@samsung.com>
Tue, 20 Sep 2022 04:56:39 +0000 (13:56 +0900)
Change-Id: I1202a655f81c33047c6a55d8b2242b87157d40ad
Signed-off-by: Suyeon Hwang <stom.hwang@samsung.com>
src/mmimgr/iu/VoiceTouchEngine.cpp

index 6ad4630..7d68d88 100644 (file)
@@ -398,6 +398,9 @@ void VoiceTouchEngine::makeGridItemList(const grid_info_s &parentInfo, std::list
        int gridWidth = parentInfo.width / numX;
        int gridHeight = parentInfo.height / numY;
 
+       int remainedWidth = parentInfo.width % numX;
+       int remainedHeight = parentInfo.height % numY;
+
        int index = 1;
 
        list.clear();
@@ -406,8 +409,10 @@ void VoiceTouchEngine::makeGridItemList(const grid_info_s &parentInfo, std::list
                        ClickableItem grid;
                        grid.coordX = coordX + (x * gridWidth);
                        grid.coordY = coordY + (y * gridHeight);
-                       grid.width = gridWidth;
-                       grid.height = gridHeight;
+
+                       grid.width = (x == numX - 1 ? gridWidth + remainedWidth : gridWidth);
+                       grid.height = (y == numY - 1 ? gridHeight + remainedHeight : gridHeight);
+
                        grid.index = index++;
 
                        list.push_back(grid);