UI: fix misaligned popover arrow near the region edge

Differential Revision: https://developer.blender.org/D5872
This commit is contained in:
Yevgeny Makarov 2019-10-01 20:02:15 +02:00 committed by Brecht Van Lommel
parent f0f189de76
commit cd9da385b0
1 changed files with 3 additions and 1 deletions

View File

@ -4914,7 +4914,9 @@ static void ui_draw_popover_back_impl(const uiWidgetColors *wcol,
{
/* tsk, this isn't nice. */
const float unit_half = unit_size / 2;
const float cent_x = mval_origin ? mval_origin[0] : BLI_rcti_cent_x(rect);
const float cent_x = mval_origin ?
CLAMPIS(mval_origin[0], rect->xmin + unit_size, rect->xmax - unit_size) :
BLI_rcti_cent_x(rect);
rect->ymax -= unit_half;
rect->ymin += unit_half;