UIL: Dragging popups wasn't updating safe-areas
This commit is contained in:
parent
9f16428cb5
commit
f61e885706
|
@ -7736,11 +7736,7 @@ static int ui_handle_menu_event(
|
|||
sub_v2_v2v2_int(mdiff, &event->x, menu->grab_xy_prev);
|
||||
copy_v2_v2_int(menu->grab_xy_prev, &event->x);
|
||||
|
||||
BLI_rcti_translate(&ar->winrct, UNPACK2(mdiff));
|
||||
|
||||
ED_region_update_rect(C, ar);
|
||||
|
||||
ED_region_tag_redraw(ar);
|
||||
ui_popup_translate(C, ar, mdiff);
|
||||
}
|
||||
|
||||
return retval;
|
||||
|
|
|
@ -473,7 +473,9 @@ struct ARegion *ui_tooltip_create(struct bContext *C, struct ARegion *butregion,
|
|||
void ui_tooltip_free(struct bContext *C, struct ARegion *ar);
|
||||
|
||||
uiBut *ui_popup_menu_memory_get(struct uiBlock *block);
|
||||
void ui_popup_menu_memory_set(struct uiBlock *block, struct uiBut *but);
|
||||
void ui_popup_menu_memory_set(uiBlock *block, struct uiBut *but);
|
||||
|
||||
void ui_popup_translate(struct bContext *C, struct ARegion *ar, const int mdiff[2]);
|
||||
|
||||
float *ui_block_hsv_get(struct uiBlock *block);
|
||||
void ui_popup_block_scrolltest(struct uiBlock *block);
|
||||
|
|
|
@ -2143,6 +2143,29 @@ void ui_popup_menu_memory_set(uiBlock *block, uiBut *but)
|
|||
ui_popup_menu_memory__internal(block, but);
|
||||
}
|
||||
|
||||
/**
|
||||
* Translate any popup regions (so we can drag them).
|
||||
*/
|
||||
void ui_popup_translate(bContext *C, ARegion *ar, const int mdiff[2])
|
||||
{
|
||||
uiBlock *block;
|
||||
|
||||
BLI_rcti_translate(&ar->winrct, UNPACK2(mdiff));
|
||||
|
||||
ED_region_update_rect(C, ar);
|
||||
|
||||
ED_region_tag_redraw(ar);
|
||||
|
||||
/* update blocks */
|
||||
for (block = ar->uiblocks.first; block; block = block->next) {
|
||||
uiSafetyRct *saferct;
|
||||
for (saferct = block->saferct.first; saferct; saferct = saferct->next) {
|
||||
BLI_rctf_translate(&saferct->parent, UNPACK2(mdiff));
|
||||
BLI_rctf_translate(&saferct->safety, UNPACK2(mdiff));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/******************** Popup Menu with callback or string **********************/
|
||||
|
||||
struct uiPopupMenu {
|
||||
|
|
Loading…
Reference in New Issue