diff options
author | Christoph Lendenfeld <ChrisLend> | 2021-03-01 18:20:55 +0300 |
---|---|---|
committer | Sybren A. Stüvel <sybren@blender.org> | 2021-03-01 18:23:15 +0300 |
commit | fdb2c24c097d9a4613493659533863efc3c6f809 (patch) | |
tree | a25d8ceb040b6bfd3d438b303aeb32219c15bd2a /source/blender/editors/util/ed_util.c | |
parent | 3649b5b6dfff8c02637648773165efe5f94aeecf (diff) |
Cleanup: move some drawing code into ed_draw.c
Move some drawing code from `area.c` and `ed_util.c` into `ed_draw.c`.
This is to support the new generic slider that wil be used in T81785.
No functional changes.
Reviewed By: #animation_rigging, #user_interface, Severin, sybren
Maniphest Tasks: T81785
Differential Revision: https://developer.blender.org/D9313
Diffstat (limited to 'source/blender/editors/util/ed_util.c')
-rw-r--r-- | source/blender/editors/util/ed_util.c | 38 |
1 files changed, 0 insertions, 38 deletions
diff --git a/source/blender/editors/util/ed_util.c b/source/blender/editors/util/ed_util.c index 695db9ba246..9903711834a 100644 --- a/source/blender/editors/util/ed_util.c +++ b/source/blender/editors/util/ed_util.c @@ -434,44 +434,6 @@ void unpack_menu(bContext *C, UI_popup_menu_end(C, pup); } -/* ********************* generic callbacks for drawcall api *********************** */ - -/** - * Callback that draws a line between the mouse and a position given as the initial argument. - */ -void ED_region_draw_mouse_line_cb(const bContext *C, ARegion *region, void *arg_info) -{ - wmWindow *win = CTX_wm_window(C); - const float *mval_src = (float *)arg_info; - const float mval_dst[2] = { - win->eventstate->x - region->winrct.xmin, - win->eventstate->y - region->winrct.ymin, - }; - - const uint shdr_pos = GPU_vertformat_attr_add( - immVertexFormat(), "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT); - - GPU_line_width(1.0f); - - immBindBuiltinProgram(GPU_SHADER_2D_LINE_DASHED_UNIFORM_COLOR); - - float viewport_size[4]; - GPU_viewport_size_get_f(viewport_size); - immUniform2f("viewport_size", viewport_size[2] / UI_DPI_FAC, viewport_size[3] / UI_DPI_FAC); - - immUniform1i("colors_len", 0); /* "simple" mode */ - immUniformThemeColor3(TH_VIEW_OVERLAY); - immUniform1f("dash_width", 6.0f); - immUniform1f("dash_factor", 0.5f); - - immBegin(GPU_PRIM_LINES, 2); - immVertex2fv(shdr_pos, mval_src); - immVertex2fv(shdr_pos, mval_dst); - immEnd(); - - immUnbindProgram(); -} - /** * Use to free ID references within runtime data (stored outside of DNA) * |