diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-05-22 15:41:49 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-05-22 16:09:21 +0300 |
commit | cc9513d944e70dc3d878864d0cde822aa3f37e3a (patch) | |
tree | 0d1bfab8501b9f32e36bc68cbea74e717d469040 /source | |
parent | d97471ddf74e1e4a122c4678a715f2e6d05a6e6c (diff) |
Fix outliner crashes when dragging elements in some cases.
Avoid rebuilding outliner tree in more cases, also helps performance.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/include/ED_screen.h | 1 | ||||
-rw-r--r-- | source/blender/editors/interface/view2d.c | 4 | ||||
-rw-r--r-- | source/blender/editors/interface/view2d_ops.c | 24 | ||||
-rw-r--r-- | source/blender/editors/screen/area.c | 11 | ||||
-rw-r--r-- | source/blender/editors/screen/screen_edit.c | 2 | ||||
-rw-r--r-- | source/blender/editors/screen/screen_ops.c | 4 | ||||
-rw-r--r-- | source/blender/editors/space_outliner/outliner_edit.c | 2 |
7 files changed, 26 insertions, 22 deletions
diff --git a/source/blender/editors/include/ED_screen.h b/source/blender/editors/include/ED_screen.h index 3d17afc2878..c30aaf8df0a 100644 --- a/source/blender/editors/include/ED_screen.h +++ b/source/blender/editors/include/ED_screen.h @@ -127,6 +127,7 @@ void ED_screen_global_areas_create( void ED_area_do_listen(struct bScreen *sc, ScrArea *sa, struct wmNotifier *note, Scene *scene, struct WorkSpace *workspace); void ED_area_tag_redraw(ScrArea *sa); +void ED_area_tag_redraw_no_rebuild(ScrArea *sa); void ED_area_tag_redraw_regiontype(ScrArea *sa, int type); void ED_area_tag_refresh(ScrArea *sa); void ED_area_do_refresh(struct bContext *C, ScrArea *sa); diff --git a/source/blender/editors/interface/view2d.c b/source/blender/editors/interface/view2d.c index c1791998ec7..012809910bf 100644 --- a/source/blender/editors/interface/view2d.c +++ b/source/blender/editors/interface/view2d.c @@ -819,7 +819,7 @@ void UI_view2d_sync(bScreen *screen, ScrArea *area, View2D *v2dcur, int flag) } /* region possibly changed, so refresh */ - ED_region_tag_redraw(ar); + ED_region_tag_redraw_no_rebuild(ar); } } } @@ -845,7 +845,7 @@ void UI_view2d_sync(bScreen *screen, ScrArea *area, View2D *v2dcur, int flag) } /* region possibly changed, so refresh */ - ED_region_tag_redraw(ar); + ED_region_tag_redraw_no_rebuild(ar); } } } diff --git a/source/blender/editors/interface/view2d_ops.c b/source/blender/editors/interface/view2d_ops.c index 4101230c1ab..4cd3aad8103 100644 --- a/source/blender/editors/interface/view2d_ops.c +++ b/source/blender/editors/interface/view2d_ops.c @@ -169,14 +169,8 @@ static void view_pan_apply_ex(bContext *C, v2dViewPanData *vpd, float dx, float /* validate that view is in valid configuration after this operation */ UI_view2d_curRect_validate(v2d); - /* exceptions */ - if (vpd->sa->spacetype == SPACE_OUTLINER) { - /* don't rebuild full tree, since we're just changing our view */ - ED_region_tag_redraw_no_rebuild(vpd->ar); - } - else { - ED_region_tag_redraw(vpd->ar); - } + /* don't rebuild full tree in outliner, since we're just changing our view */ + ED_region_tag_redraw_no_rebuild(vpd->ar); /* request updates to be done... */ WM_event_add_mousemove(C); @@ -734,7 +728,7 @@ static void view_zoomstep_apply_ex( } /* request updates to be done... */ - ED_region_tag_redraw(vzd->ar); + ED_region_tag_redraw_no_rebuild(vzd->ar); UI_view2d_sync(CTX_wm_screen(C), CTX_wm_area(C), v2d, V2D_LOCK_COPY); } @@ -978,7 +972,7 @@ static void view_zoomdrag_apply(bContext *C, wmOperator *op) } /* request updates to be done... */ - ED_region_tag_redraw(vzd->ar); + ED_region_tag_redraw_no_rebuild(vzd->ar); UI_view2d_sync(CTX_wm_screen(C), CTX_wm_area(C), v2d, V2D_LOCK_COPY); } @@ -1493,7 +1487,7 @@ void UI_view2d_smooth_view( v2d->cur = sms.new_cur; UI_view2d_curRect_validate(v2d); - ED_region_tag_redraw(ar); + ED_region_tag_redraw_no_rebuild(ar); UI_view2d_sync(CTX_wm_screen(C), CTX_wm_area(C), v2d, V2D_LOCK_COPY); } } @@ -1537,7 +1531,7 @@ static int view2d_smoothview_invoke(bContext *C, wmOperator *UNUSED(op), const w UI_view2d_curRect_validate(v2d); UI_view2d_sync(CTX_wm_screen(C), CTX_wm_area(C), v2d, V2D_LOCK_COPY); - ED_region_tag_redraw(ar); + ED_region_tag_redraw_no_rebuild(ar); if (v2d->sms == NULL) { UI_view2d_zoom_cache_reset(); @@ -1749,7 +1743,7 @@ static void scroller_activate_init(bContext *C, wmOperator *op, const wmEvent *e } UI_view2d_scrollers_free(scrollers); - ED_region_tag_redraw(ar); + ED_region_tag_redraw_no_rebuild(ar); } /* cleanup temp customdata */ @@ -1763,7 +1757,7 @@ static void scroller_activate_exit(bContext *C, wmOperator *op) MEM_freeN(op->customdata); op->customdata = NULL; - ED_region_tag_redraw(CTX_wm_region(C)); + ED_region_tag_redraw_no_rebuild(CTX_wm_region(C)); } } @@ -1825,7 +1819,7 @@ static void scroller_activate_apply(bContext *C, wmOperator *op) UI_view2d_curRect_validate(v2d); /* request updates to be done... */ - ED_region_tag_redraw(vsm->ar); + ED_region_tag_redraw_no_rebuild(vsm->ar); UI_view2d_sync(CTX_wm_screen(C), CTX_wm_area(C), v2d, V2D_LOCK_COPY); } diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c index b2245886991..1688e45d98c 100644 --- a/source/blender/editors/screen/area.c +++ b/source/blender/editors/screen/area.c @@ -225,7 +225,7 @@ void ED_area_azones_update(ScrArea *sa, const int mouse_xy[2]) if (changed) { sa->flag &= ~AREA_FLAG_ACTIONZONES_UPDATE; - ED_area_tag_redraw(sa); + ED_area_tag_redraw_no_rebuild(sa); } } @@ -607,6 +607,15 @@ void ED_area_tag_redraw(ScrArea *sa) ED_region_tag_redraw(ar); } +void ED_area_tag_redraw_no_rebuild(ScrArea *sa) +{ + ARegion *ar; + + if (sa) + for (ar = sa->regionbase.first; ar; ar = ar->next) + ED_region_tag_redraw_no_rebuild(ar); +} + void ED_area_tag_redraw_regiontype(ScrArea *sa, int regiontype) { ARegion *ar; diff --git a/source/blender/editors/screen/screen_edit.c b/source/blender/editors/screen/screen_edit.c index 77f7aacb68e..10db5e4aea5 100644 --- a/source/blender/editors/screen/screen_edit.c +++ b/source/blender/editors/screen/screen_edit.c @@ -1041,7 +1041,7 @@ void ED_screen_set_active_region(bContext *C, wmWindow *win, const int xy[2]) if (do_draw) { for (ar = area_iter->regionbase.first; ar; ar = ar->next) { if (ar->regiontype == RGN_TYPE_HEADER) { - ED_region_tag_redraw(ar); + ED_region_tag_redraw_no_rebuild(ar); } } } diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c index db8a38c6f3c..f63c9d465df 100644 --- a/source/blender/editors/screen/screen_ops.c +++ b/source/blender/editors/screen/screen_ops.c @@ -707,7 +707,7 @@ AZone *is_in_area_actionzone(ScrArea *sa, const int xy[2]) } /* XXX force redraw to show/hide the action zone */ - ED_area_tag_redraw(sa); + ED_area_tag_redraw_no_rebuild(sa); break; } else if (az->type == AZONE_REGION_SCROLL) { @@ -759,7 +759,7 @@ AZone *is_in_area_actionzone(ScrArea *sa, const int xy[2]) } if (redraw) { - ED_area_tag_redraw(sa); + ED_area_tag_redraw_no_rebuild(sa); } /* Don't return! */ } diff --git a/source/blender/editors/space_outliner/outliner_edit.c b/source/blender/editors/space_outliner/outliner_edit.c index 5922e208f36..9bd0c622d66 100644 --- a/source/blender/editors/space_outliner/outliner_edit.c +++ b/source/blender/editors/space_outliner/outliner_edit.c @@ -1057,7 +1057,7 @@ static int outliner_scroll_page_exec(bContext *C, wmOperator *op) ar->v2d.cur.ymin += dy; ar->v2d.cur.ymax += dy; - ED_region_tag_redraw(ar); + ED_region_tag_redraw_no_rebuild(ar); return OPERATOR_FINISHED; } |