diff options
Diffstat (limited to 'source/blender/editors/interface')
-rw-r--r-- | source/blender/editors/interface/interface_widgets.c | 7 | ||||
-rw-r--r-- | source/blender/editors/interface/view2d.c | 11 | ||||
-rw-r--r-- | source/blender/editors/interface/view2d_ops.c | 24 |
3 files changed, 24 insertions, 18 deletions
diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c index c4de2730600..1be62e535de 100644 --- a/source/blender/editors/interface/interface_widgets.c +++ b/source/blender/editors/interface/interface_widgets.c @@ -1181,12 +1181,7 @@ void UI_widgetbase_draw_cache_flush(void) MAX_WIDGET_PARAMETERS * MAX_WIDGET_BASE_BATCH, (float *)g_widget_base_batch.params); GPU_batch_uniform_3fv(batch, "checkerColorAndSize", checker_params); - GPU_matrix_bind(batch->interface); - GPU_shader_set_srgb_uniform(batch->interface); - GPU_batch_bind(batch); - GPU_batch_draw_advanced(batch, 0, 0, 0, g_widget_base_batch.count); - - GPU_batch_program_use_end(batch); + GPU_batch_draw_instanced(batch, g_widget_base_batch.count); } g_widget_base_batch.count = 0; } diff --git a/source/blender/editors/interface/view2d.c b/source/blender/editors/interface/view2d.c index 3efed43e08c..f15a95880f8 100644 --- a/source/blender/editors/interface/view2d.c +++ b/source/blender/editors/interface/view2d.c @@ -853,6 +853,17 @@ void UI_view2d_curRect_validate(View2D *v2d) ui_view2d_curRect_validate_resize(v2d, false); } +void UI_view2d_curRect_changed(const bContext *C, View2D *v2d) +{ + UI_view2d_curRect_validate(v2d); + + ARegion *region = CTX_wm_region(C); + + if (region->type->on_view2d_changed != NULL) { + region->type->on_view2d_changed(C, region); + } +} + /* ------------------ */ /* Called by menus to activate it, or by view2d operators diff --git a/source/blender/editors/interface/view2d_ops.c b/source/blender/editors/interface/view2d_ops.c index d62058699d9..7caa61ec91d 100644 --- a/source/blender/editors/interface/view2d_ops.c +++ b/source/blender/editors/interface/view2d_ops.c @@ -185,8 +185,8 @@ static void view_pan_apply_ex(bContext *C, v2dViewPanData *vpd, float dx, float v2d->cur.ymax += dy; } - /* validate that view is in valid configuration after this operation */ - UI_view2d_curRect_validate(v2d); + /* Inform v2d about changes after this operation. */ + UI_view2d_curRect_changed(C, v2d); /* don't rebuild full tree in outliner, since we're just changing our view */ ED_region_tag_redraw_no_rebuild(vpd->region); @@ -957,8 +957,8 @@ static void view_zoomstep_apply_ex( } } - /* validate that view is in valid configuration after this operation */ - UI_view2d_curRect_validate(v2d); + /* Inform v2d about changes after this operation. */ + UI_view2d_curRect_changed(C, v2d); if (ED_region_snap_size_apply(region, snap_test)) { ScrArea *area = CTX_wm_area(C); @@ -1216,8 +1216,8 @@ static void view_zoomdrag_apply(bContext *C, wmOperator *op) } } - /* validate that view is in valid configuration after this operation */ - UI_view2d_curRect_validate(v2d); + /* Inform v2d about changes after this operation. */ + UI_view2d_curRect_changed(C, v2d); if (ED_region_snap_size_apply(vzd->region, snap_test)) { ScrArea *area = CTX_wm_area(C); @@ -1806,7 +1806,7 @@ void UI_view2d_smooth_view(bContext *C, ARegion *region, const rctf *cur, const if (ok == false) { v2d->cur = sms.new_cur; - UI_view2d_curRect_validate(v2d); + UI_view2d_curRect_changed(C, v2d); ED_region_tag_redraw_no_rebuild(region); UI_view2d_sync(CTX_wm_screen(C), CTX_wm_area(C), v2d, V2D_LOCK_COPY); } @@ -1853,7 +1853,7 @@ static int view2d_smoothview_invoke(bContext *C, wmOperator *UNUSED(op), const w BLI_rctf_interp(&v2d->cur, &sms->orig_cur, &sms->new_cur, step); } - UI_view2d_curRect_validate(v2d); + UI_view2d_curRect_changed(C, v2d); UI_view2d_sync(CTX_wm_screen(C), CTX_wm_area(C), v2d, V2D_LOCK_COPY); ED_region_tag_redraw_no_rebuild(region); @@ -2176,8 +2176,8 @@ static void scroller_activate_apply(bContext *C, wmOperator *op) break; } - /* validate that view is in valid configuration after this operation */ - UI_view2d_curRect_validate(v2d); + /* Inform v2d about changes after this operation. */ + UI_view2d_curRect_changed(C, v2d); /* request updates to be done... */ ED_region_tag_redraw_no_rebuild(vsm->region); @@ -2410,8 +2410,8 @@ static int reset_exec(bContext *C, wmOperator *UNUSED(op)) } } - /* validate that view is in valid configuration after this operation */ - UI_view2d_curRect_validate(v2d); + /* Inform v2d about changes after this operation. */ + UI_view2d_curRect_changed(C, v2d); if (ED_region_snap_size_apply(region, snap_test)) { ScrArea *area = CTX_wm_area(C); |