[Bf-blender-cvs] [313c958] gooseberry: More cosmetic stuff for the play button

Antony Riakiotakis noreply at git.blender.org
Tue Jun 9 18:15:44 CEST 2015


Commit: 313c958f438c103a45f62679069e069788d992d3
Author: Antony Riakiotakis
Date:   Tue Jun 9 18:15:32 2015 +0200
Branches: gooseberry
https://developer.blender.org/rB313c958f438c103a45f62679069e069788d992d3

More cosmetic stuff for the play button

Draw outer ring with quad strip instead of line
(line width would vary across the ring)

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

M	source/blender/editors/include/BIF_glutil.h
M	source/blender/editors/screen/glutil.c
M	source/blender/editors/space_file/file_draw.c

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

diff --git a/source/blender/editors/include/BIF_glutil.h b/source/blender/editors/include/BIF_glutil.h
index d64c44d..7292e8b 100644
--- a/source/blender/editors/include/BIF_glutil.h
+++ b/source/blender/editors/include/BIF_glutil.h
@@ -89,6 +89,9 @@ void glutil_draw_lined_arc(float start, float angle, float radius, int nsegments
  */
 void glutil_draw_filled_arc(float start, float angle, float radius, int nsegments);
 
+
+void glutil_draw_filled_arc_part(float start, float angle, float radius, float radius_inn, int nsegments);
+
 /**
  * Returns an integer value as obtained by glGetIntegerv.
  * The param must cause only one value to be gotten from GL.
diff --git a/source/blender/editors/screen/glutil.c b/source/blender/editors/screen/glutil.c
index 5cd76a6..ca0fd17 100644
--- a/source/blender/editors/screen/glutil.c
+++ b/source/blender/editors/screen/glutil.c
@@ -422,6 +422,24 @@ void glutil_draw_filled_arc(float start, float angle, float radius, int nsegment
 	glEnd();
 }
 
+void glutil_draw_filled_arc_part(float start, float angle, float radius, float radius_inn, int nsegments)
+{
+	int i;
+
+	glBegin(GL_QUAD_STRIP);
+	glVertex2f(cosf(start) * radius_inn, sinf(start) * radius_inn);
+	glVertex2f(cosf(start) * radius, sinf(start) * radius);
+	for (i = 0; i < nsegments; i++) {
+		float t = (float) i / (nsegments - 1);
+		float cur = start + t * angle;
+
+		glVertex2f(cosf(cur) * radius_inn, sinf(cur) * radius_inn);
+		glVertex2f(cosf(cur) * radius, sinf(cur) * radius);
+	}
+	glEnd();
+}
+
+
 void glutil_draw_lined_arc(float start, float angle, float radius, int nsegments)
 {
 	int i;
diff --git a/source/blender/editors/space_file/file_draw.c b/source/blender/editors/space_file/file_draw.c
index bea2573..db10aa1 100644
--- a/source/blender/editors/space_file/file_draw.c
+++ b/source/blender/editors/space_file/file_draw.c
@@ -412,8 +412,8 @@ static void file_draw_preview(uiBlock *block, struct direntry *file, int sx, int
 		UI_but_drag_set_image(but, file->path, get_file_icon(file), imb, scale);
 	}
 
-	if (play) {
-		float r = MIN2(ey, ex) / 5.0f;
+	if (play && !is_icon) {
+		float r = MIN2(ey, ex) / 6.0f;
 		float yr = sqrt(3) / 2 * r;
 		float xr = r / 2;
 		glPushMatrix();
@@ -421,9 +421,7 @@ static void file_draw_preview(uiBlock *block, struct direntry *file, int sx, int
 		glColor4f(1.0f, 1.0f, 1.0f, 0.8);
 		glutil_draw_filled_arc(0.0f, 2.0f * M_PI, ey / 4.0f, 32);
 		glColor4f(0.3f, 0.3f, 1.0f, 0.8f);
-		glLineWidth(3.0);
-		glutil_draw_lined_arc(0.0f, 2.0f * M_PI, ey / 4.0f, 32);
-		glLineWidth(1.0);
+		glutil_draw_filled_arc_part(0.0f, 2.0f * M_PI, ey / 4.0f, ey / 5.0f, 32);
 		glBegin(GL_TRIANGLES);
 		glVertex2f(-xr, yr);
 		glVertex2f(-xr, -yr);




More information about the Bf-blender-cvs mailing list