[Bf-blender-cvs] [76416f336a1] master: Cleanup: Move function to proper file

Hans Goudey noreply at git.blender.org
Wed Nov 4 22:38:23 CET 2020


Commit: 76416f336a1b5d705baf7b28ef9fbc726566c8c1
Author: Hans Goudey
Date:   Wed Nov 4 15:38:11 2020 -0600
Branches: master
https://developer.blender.org/rB76416f336a1b5d705baf7b28ef9fbc726566c8c1

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.

===================================================================

M	source/blender/editors/interface/interface_panel.c
M	source/blender/editors/interface/interface_widgets.c

===================================================================

diff --git a/source/blender/editors/interface/interface_panel.c b/source/blender/editors/interface/interface_panel.c
index af7b674df7f..d02cfdc8940 100644
--- a/source/blender/editors/interface/interface_panel.c
+++ b/source/blender/editors/interface/interface_panel.c
@@ -1041,24 +1041,6 @@ void UI_panels_draw(const bContext *C, ARegion *region)
   }
 }
 
-/* Triangle 'icon' for panel header. */
-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);
-  }
-}
-
 #define PNL_ICON UI_UNIT_X /* Could be UI_UNIT_Y too. */
 
 /* For button layout next to label. */
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])
 {



More information about the Bf-blender-cvs mailing list