Fix issue devided by zero 52/305152/1
authorJihoon Kim <jihoon48.kim@samsung.com>
Mon, 22 Jan 2024 06:35:31 +0000 (15:35 +0900)
committerJihoon Kim <jihoon48.kim@samsung.com>
Mon, 29 Jan 2024 10:07:10 +0000 (19:07 +0900)
Change-Id: Id1fb7095e948b8203ee0d8870d5305c4e3fc65fd
Signed-off-by: Jihoon Kim <jihoon48.kim@samsung.com>
scl/sclcontroller.cpp

index 6e08ae3..e7ff6d0 100644 (file)
@@ -4005,8 +4005,10 @@ CSCLController::configure_autopopup_window(sclwindow window, sclbyte key_index,
                 if (rect->x + rect->width > baseWndRect.x + baseWndRect.width) {
                     sclint relocate_unit = autopopup_configure->button_width * utils->get_custom_scale_rate_x() +
                         autopopup_configure->button_spacing * utils->get_smallest_custom_scale_rate();
-                    rect->x -= (((rect->x + rect->width - (baseWndRect.x + baseWndRect.width)) /
-                            relocate_unit) + 1) * relocate_unit;
+
+                    if (relocate_unit != 0)
+                        rect->x -= (((rect->x + rect->width - (baseWndRect.x + baseWndRect.width)) /
+                                    relocate_unit) + 1) * relocate_unit;
                 }
             } else {
                 /* We're growing right to left, calculate the right end point */
@@ -4017,8 +4019,10 @@ CSCLController::configure_autopopup_window(sclwindow window, sclbyte key_index,
                 if (rect->x < baseWndRect.x) {
                     sclint relocate_unit = autopopup_configure->button_width * utils->get_custom_scale_rate_x() +
                         autopopup_configure->button_spacing * utils->get_smallest_custom_scale_rate();
-                    rect->x += (((baseWndRect.x - rect->x) /
-                            relocate_unit) + 1) * relocate_unit;
+
+                    if (relocate_unit != 0)
+                        rect->x += (((baseWndRect.x - rect->x) /
+                                    relocate_unit) + 1) * relocate_unit;
                 }
             }
             //rect->y = (scrheight - layout->height) + coordinate->y - rect->height + autopopup_configure->decoration_size;