UI: tweak tooltip placement

Only apply offset w/ non overlapping placement.
This commit is contained in:
Campbell Barton
2018-09-05 17:10:59 +10:00
parent 717f976a0e
commit 2ffe7dbef1

View File

@@ -1184,7 +1184,9 @@ static ARegion *ui_tooltip_create_with_data(
{
/* Compensate for margin offset, visually this corrects the position. */
const int margin = UI_POPUP_MARGIN;
BLI_rcti_translate(&rect_i, margin, margin / 2);
if (init_rect_overlap != NULL) {
BLI_rcti_translate(&rect_i, margin, margin / 2);
}
data->bbox.xmin = margin;
data->bbox.xmax = BLI_rcti_size_x(&rect_i) - margin;