UI: tweak tooltip placement
authorCampbell Barton <ideasman42@gmail.com>
Wed, 5 Sep 2018 07:10:59 +0000 (17:10 +1000)
committerCampbell Barton <ideasman42@gmail.com>
Wed, 5 Sep 2018 07:10:59 +0000 (17:10 +1000)
Only apply offset w/ non overlapping placement.

source/blender/editors/interface/interface_region_tooltip.c

index 3e1ef06c7b972b98bd12434067c3b038e485d048..9cf38f66fe5f97676b7ce8105e4b4db3bba55f01 100644 (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;