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 */
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;