diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-04-10 12:59:23 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-04-10 13:00:10 +0300 |
commit | 6962119e7f9152d99dac60a5bea76d7c6829d6c9 (patch) | |
tree | c21fd2fdecac15db849ef24a8baa91dd7c2908ab /source/blender/editors | |
parent | a74e782f5b3e1df763274e3c8f803562dbbd9a89 (diff) | |
parent | 5c3857b3051ff9f40e606ae2fc59f68a1747f1d7 (diff) |
Merge branch 'master' into blender2.8
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/interface/interface_region_popup.c | 17 | ||||
-rw-r--r-- | source/blender/editors/screen/area.c | 24 | ||||
-rw-r--r-- | source/blender/editors/space_graph/space_graph.c | 2 |
3 files changed, 37 insertions, 6 deletions
diff --git a/source/blender/editors/interface/interface_region_popup.c b/source/blender/editors/interface/interface_region_popup.c index c3d6d635c17..67383ec73a6 100644 --- a/source/blender/editors/interface/interface_region_popup.c +++ b/source/blender/editors/interface/interface_region_popup.c @@ -302,19 +302,36 @@ static void ui_block_position(wmWindow *window, ARegion *butregion, uiBut *but, static void ui_block_region_draw(const bContext *C, ARegion *ar) { + ScrArea *ctx_area = CTX_wm_area(C); + ARegion *ctx_region = CTX_wm_region(C); uiBlock *block; if (ar->do_draw & RGN_DRAW_REFRESH_UI) { + ScrArea *handle_ctx_area; + ARegion *handle_ctx_region; uiBlock *block_next; + ar->do_draw &= ~RGN_DRAW_REFRESH_UI; for (block = ar->uiblocks.first; block; block = block_next) { block_next = block->next; if (block->handle->can_refresh) { + handle_ctx_area = block->handle->ctx_area; + handle_ctx_region = block->handle->ctx_region; + + if (handle_ctx_area) { + CTX_wm_area_set((bContext *)C, handle_ctx_area); + } + if (handle_ctx_region) { + CTX_wm_region_set((bContext *)C, handle_ctx_region); + } ui_popup_block_refresh((bContext *)C, block->handle, NULL, NULL); } } } + CTX_wm_area_set((bContext *)C, ctx_area); + CTX_wm_region_set((bContext *)C, ctx_region); + for (block = ar->uiblocks.first; block; block = block->next) UI_block_draw(C, block); } diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c index 390098b3ea3..105fff38f62 100644 --- a/source/blender/editors/screen/area.c +++ b/source/blender/editors/screen/area.c @@ -2015,15 +2015,29 @@ void ED_region_panels(const bContext *C, ARegion *ar, const char *context, int c /* before setting the view */ if (vertical) { /* we always keep the scroll offset - so the total view gets increased with the scrolled away part */ - if (v2d->cur.ymax < - 0.001f) - y = min_ii(y, v2d->cur.ymin); - + if (v2d->cur.ymax < -FLT_EPSILON) { + /* Clamp to lower view boundary */ + if (v2d->tot.ymin < -v2d->winy) { + y = min_ii(y, 0); + } + else { + y = min_ii(y, v2d->cur.ymin); + } + } + y = -y; } else { /* don't jump back when panels close or hide */ - if (!is_context_new) - x = max_ii(x, v2d->cur.xmax); + if (!is_context_new) { + if (v2d->tot.xmax > v2d->winx) { + x = max_ii(x, 0); + } + else { + x = max_ii(x, v2d->cur.xmax); + } + } + y = -y; } diff --git a/source/blender/editors/space_graph/space_graph.c b/source/blender/editors/space_graph/space_graph.c index b03c6a2eb0b..104fff986cf 100644 --- a/source/blender/editors/space_graph/space_graph.c +++ b/source/blender/editors/space_graph/space_graph.c @@ -703,7 +703,7 @@ static void graph_id_remap(ScrArea *UNUSED(sa), SpaceLink *slink, ID *old_id, ID if (sgraph->ads && (ID *)sgraph->ads->filter_grp == old_id) { sgraph->ads->filter_grp = (Group *)new_id; } - if ((ID *)sgraph->ads->source == old_id) { + if (sgraph->ads && (ID *)sgraph->ads->source == old_id) { sgraph->ads->source = new_id; } } |