diff options
author | Campbell Barton <ideasman42@gmail.com> | 2020-05-11 11:28:41 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2020-05-11 11:30:02 +0300 |
commit | 668867558e68b064c507b1f23508b65b0343f0f1 (patch) | |
tree | f2195a80fe854eeaaedbc5e2cac3568be8b7c92e /source/blender | |
parent | d6f48e21fccc270d797a6742a77058f3613655a2 (diff) |
UI: apply vertical tool-tip offset in pixel-space
Was applying in ui-block space which changed offset
at different zoom levels.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/editors/interface/interface_region_tooltip.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/source/blender/editors/interface/interface_region_tooltip.c b/source/blender/editors/interface/interface_region_tooltip.c index 58a13c6c456..b64f080d9cc 100644 --- a/source/blender/editors/interface/interface_region_tooltip.c +++ b/source/blender/editors/interface/interface_region_tooltip.c @@ -756,7 +756,7 @@ static uiTooltipData *ui_tooltip_data_from_tool(bContext *C, uiBut *but, bool is } } #else - UNUSED_VARS(is_label); + UNUSED_VARS(is_label, has_valid_context, has_valid_context_error); #endif /* WITH_PYTHON */ if (data->fields_len == 0) { @@ -1451,11 +1451,12 @@ ARegion *UI_tooltip_create_from_button(bContext *C, ARegion *butregion, uiBut *b } else { init_position[0] = BLI_rctf_cent_x(&but->rect); - init_position[1] = but->rect.ymin - (UI_POPUP_MARGIN / 2); + init_position[1] = but->rect.ymin; if (butregion) { ui_block_to_window_fl(butregion, but->block, &init_position[0], &init_position[1]); init_position[0] = win->eventstate->x; } + init_position[1] -= (UI_POPUP_MARGIN / 2); } ARegion *region = ui_tooltip_create_with_data( |