diff options
-rw-r--r-- | source/blender/editors/screen/screen_draw.c | 132 |
1 files changed, 0 insertions, 132 deletions
diff --git a/source/blender/editors/screen/screen_draw.c b/source/blender/editors/screen/screen_draw.c index 928ed05f1de..60fe1dfa483 100644 --- a/source/blender/editors/screen/screen_draw.c +++ b/source/blender/editors/screen/screen_draw.c @@ -295,140 +295,8 @@ static GPUBatch *batch_screen_edges_get(int *corner_len) return screen_edges_batch; } -static void drawscredge_corner_geometry( - int sizex, int sizey, - int corner_x, int corner_y, - int center_x, int center_y, - double angle_offset, - const float *color) -{ - const int radius = ABS(corner_x - center_x); - const int line_thickness = U.pixelsize; - - if (corner_x < center_x) { - if (corner_x > 0.0f) { - /* Left (internal) edge. */ - corner_x += line_thickness; - center_x += line_thickness; - } - } - else { - /* Right (internal) edge. */ - if (corner_x < sizex - 1) { - corner_x += 1 - line_thickness; - center_x += 1 - line_thickness; - } - else { - /* Corner case, extreme right edge. */ - corner_x += 1; - center_x += 1; - } - } - - if (corner_y < center_y) { - if (corner_y > 0.0f) { - /* Bottom (internal) edge. */ - corner_y += line_thickness; - center_y += line_thickness; - } - } - else { - /* Top (internal) edge. */ - if (corner_y < sizey) { - corner_y += 1 - line_thickness; - center_y += 1 - line_thickness; - } - } - - float tri_array[CORNER_RESOLUTION + 1][2]; - - tri_array[0][0] = corner_x; - tri_array[0][1] = corner_y; - - for (int i = 0; i < CORNER_RESOLUTION; i++) { - double angle = angle_offset + (M_PI_2 * ((float)i / (CORNER_RESOLUTION - 1))); - float x = center_x + (radius * cos(angle)); - float y = center_y + (radius * sin(angle)); - tri_array[i + 1][0] = x; - tri_array[i + 1][1] = y; - } - - UI_draw_anti_fan(tri_array, CORNER_RESOLUTION + 1, color); -} - #undef CORNER_RESOLUTION -static void drawscredge_corner(ScrArea *sa, int sizex, int sizey) -{ - int size = 10 * U.pixelsize; - float color[4] = {0}; - UI_GetThemeColor4fv(TH_EDITOR_OUTLINE, color); - - /* Bottom-Left. */ - drawscredge_corner_geometry(sizex, sizey, - sa->v1->vec.x, - sa->v1->vec.y, - sa->v1->vec.x + size, - sa->v1->vec.y + size, - M_PI_2 * 2.0f, - color); - - /* Top-Left. */ - drawscredge_corner_geometry(sizex, sizey, - sa->v2->vec.x, - sa->v2->vec.y, - sa->v2->vec.x + size, - sa->v2->vec.y - size, - M_PI_2, - color); - - /* Top-Right. */ - drawscredge_corner_geometry(sizex, sizey, - sa->v3->vec.x, - sa->v3->vec.y, - sa->v3->vec.x - size, - sa->v3->vec.y - size, - 0.0f, - color); - - /* Bottom-Right. */ - drawscredge_corner_geometry(sizex, sizey, - sa->v4->vec.x, - sa->v4->vec.y, - sa->v4->vec.x - size, - sa->v4->vec.y + size, - M_PI_2 * 3.0f, - color); - - /* Wrap up the corners with a nice embossing. */ - rcti rect = sa->totrct; - - uint pos = GPU_vertformat_attr_add(immVertexFormat(), "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT); - immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); - - immUniformColor4fv(color); - immBeginAtMost(GPU_PRIM_LINES, 8); - - /* Right. */ - immVertex2f(pos, rect.xmax, rect.ymax); - immVertex2f(pos, rect.xmax, rect.ymin); - - /* Bottom. */ - immVertex2f(pos, rect.xmax, rect.ymin); - immVertex2f(pos, rect.xmin, rect.ymin); - - /* Left. */ - immVertex2f(pos, rect.xmin, rect.ymin); - immVertex2f(pos, rect.xmin, rect.ymax); - - /* Top. */ - immVertex2f(pos, rect.xmin, rect.ymax); - immVertex2f(pos, rect.xmax, rect.ymax); - - immEnd(); - immUnbindProgram(); -} - /** * Draw screen area darker with arrow (visualization of future joining). */ |