[Bf-blender-cvs] [342d62291b0] blender2.8: Action Zone: No need for drawing (the triangles)
Dalai Felinto
noreply at git.blender.org
Sun Apr 22 19:54:43 CEST 2018
Commit: 342d62291b0c754313886d4e6051c94da8ab2e52
Author: Dalai Felinto
Date: Sun Apr 22 19:54:19 2018 +0200
Branches: blender2.8
https://developer.blender.org/rB342d62291b0c754313886d4e6051c94da8ab2e52
Action Zone: No need for drawing (the triangles)
Now that we can easily tell the corners apart, there is no need to
a specific action zone draw here (cursor still changes, naturally).
===================================================================
M source/blender/editors/screen/area.c
===================================================================
diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c
index db06c66207f..cf5ace11e49 100644
--- a/source/blender/editors/screen/area.c
+++ b/source/blender/editors/screen/area.c
@@ -265,57 +265,9 @@ static void area_draw_azone_fullscreen(short x1, short y1, short x2, short y2, f
/**
* \brief Corner widgets use for dragging and splitting the view.
*/
-static void area_draw_azone(short x1, short y1, short x2, short y2)
+static void area_draw_azone(short UNUSED(x1), short UNUSED(y1), short UNUSED(x2), short UNUSED(y2))
{
- int dx = x2 - x1;
- int dy = y2 - y1;
-
- dx = copysign(ceilf(0.3f * abs(dx)), dx);
- dy = copysign(ceilf(0.3f * abs(dy)), dy);
-
- glEnable(GL_LINE_SMOOTH);
-
- Gwn_VertFormat *format = immVertexFormat();
- unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT);
- unsigned int col = GWN_vertformat_attr_add(format, "color", GWN_COMP_U8, 4, GWN_FETCH_INT_TO_FLOAT_UNIT);
-
- immBindBuiltinProgram(GPU_SHADER_2D_FLAT_COLOR);
- immBegin(GWN_PRIM_LINES, 12);
-
- immAttrib4ub(col, 255, 255, 255, 180);
- immVertex2f(pos, x1, y2);
- immAttrib4ub(col, 255, 255, 255, 180);
- immVertex2f(pos, x2, y1);
-
- immAttrib4ub(col, 255, 255, 255, 130);
- immVertex2f(pos, x1, y2 - dy);
- immAttrib4ub(col, 255, 255, 255, 130);
- immVertex2f(pos, x2 - dx, y1);
-
- immAttrib4ub(col, 255, 255, 255, 80);
- immVertex2f(pos, x1, y2 - 2 * dy);
- immAttrib4ub(col, 255, 255, 255, 80);
- immVertex2f(pos, x2 - 2 * dx, y1);
-
- immAttrib4ub(col, 0, 0, 0, 210);
- immVertex2f(pos, x1, y2 + 1);
- immAttrib4ub(col, 0, 0, 0, 210);
- immVertex2f(pos, x2 + 1, y1);
-
- immAttrib4ub(col, 0, 0, 0, 180);
- immVertex2f(pos, x1, y2 - dy + 1);
- immAttrib4ub(col, 0, 0, 0, 180);
- immVertex2f(pos, x2 - dx + 1, y1);
-
- immAttrib4ub(col, 0, 0, 0, 150);
- immVertex2f(pos, x1, y2 - 2 * dy + 1);
- immAttrib4ub(col, 0, 0, 0, 150);
- immVertex2f(pos, x2 - 2 * dx + 1, y1);
-
- immEnd();
- immUnbindProgram();
-
- glDisable(GL_LINE_SMOOTH);
+ /* No drawing needed since all corners are action zone, and visually distinguishable. */
}
static void region_draw_azone_icon(AZone *az)
More information about the Bf-blender-cvs
mailing list