From: Jihoon Kim Date: Mon, 22 Jan 2024 06:35:31 +0000 (+0900) Subject: Fix issue devided by zero X-Git-Tag: accepted/tizen/unified/20240122.175430~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=236ffe9b738588e8270494a74bc9f97e4f8fd4fc;p=platform%2Fcore%2Fuifw%2Flibscl-ui-nui.git Fix issue devided by zero Change-Id: Id1fb7095e948b8203ee0d8870d5305c4e3fc65fd Signed-off-by: Jihoon Kim --- diff --git a/scl/sclcontroller.cpp b/scl/sclcontroller.cpp index 3617ace..6cca200 100644 --- a/scl/sclcontroller.cpp +++ b/scl/sclcontroller.cpp @@ -4007,8 +4007,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 */ @@ -4019,8 +4021,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;