[Bf-blender-cvs] [cd9da385b01] master: UI: fix misaligned popover arrow near the region edge

Yevgeny Makarov noreply at git.blender.org
Tue Oct 1 20:12:48 CEST 2019


Commit: cd9da385b0111f0814d36125a25399e059b36e54
Author: Yevgeny Makarov
Date:   Tue Oct 1 20:02:15 2019 +0200
Branches: master
https://developer.blender.org/rBcd9da385b0111f0814d36125a25399e059b36e54

UI: fix misaligned popover arrow near the region edge

Differential Revision: https://developer.blender.org/D5872

===================================================================

M	source/blender/editors/interface/interface_widgets.c

===================================================================

diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c
index 6d2d5ddd5b9..9f1b11d1354 100644
--- a/source/blender/editors/interface/interface_widgets.c
+++ b/source/blender/editors/interface/interface_widgets.c
@@ -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;



More information about the Bf-blender-cvs mailing list