Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans Goudey <h.goudey@me.com>2020-11-05 00:38:11 +0300
committerHans Goudey <h.goudey@me.com>2020-11-05 00:38:11 +0300
commit76416f336a1b5d705baf7b28ef9fbc726566c8c1 (patch)
tree66ccb4ef99779cf58239837cc4985ee1a04442a6 /source/blender/editors/interface/interface_widgets.c
parent7ee518cf705fcebee2d110bfbb6bf00a0f170efb (diff)
Cleanup: Move function to proper file
This lower level drawing function didn't make sense in the panel code, especially when it is used in multiple other places.
Diffstat (limited to 'source/blender/editors/interface/interface_widgets.c')
-rw-r--r--source/blender/editors/interface/interface_widgets.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c
index e2250c764b1..f2afe27f40f 100644
--- a/source/blender/editors/interface/interface_widgets.c
+++ b/source/blender/editors/interface/interface_widgets.c
@@ -548,6 +548,24 @@ void UI_draw_anti_tria(
GPU_blend(GPU_BLEND_NONE);
}
+/* Triangle 'icon' for panel header and other cases. */
+void UI_draw_icon_tri(float x, float y, char dir, const float color[4])
+{
+ const float f3 = 0.05 * U.widget_unit;
+ const float f5 = 0.15 * U.widget_unit;
+ const float f7 = 0.25 * U.widget_unit;
+
+ if (dir == 'h') {
+ UI_draw_anti_tria(x - f3, y - f5, x - f3, y + f5, x + f7, y, color);
+ }
+ else if (dir == 't') {
+ UI_draw_anti_tria(x - f5, y - f7, x + f5, y - f7, x, y + f3, color);
+ }
+ else { /* 'v' = vertical, down. */
+ UI_draw_anti_tria(x - f5, y + f3, x + f5, y + f3, x, y - f7, color);
+ }
+}
+
/* triangle 'icon' inside rect */
void ui_draw_anti_tria_rect(const rctf *rect, char dir, const float color[4])
{