[Bf-blender-cvs] [1cfe0c1] master: UI: scale timeline cache-height by DPI/pixelsize

Campbell Barton noreply at git.blender.org
Tue Feb 10 12:35:39 CET 2015


Commit: 1cfe0c1fb227cab7fc28e253fc591a362c31ffc5
Author: Campbell Barton
Date:   Tue Feb 10 22:33:52 2015 +1100
Branches: master
https://developer.blender.org/rB1cfe0c1fb227cab7fc28e253fc591a362c31ffc5

UI: scale timeline cache-height by DPI/pixelsize

D602 by @blakenator with edits

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

M	source/blender/editors/space_time/space_time.c

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

diff --git a/source/blender/editors/space_time/space_time.c b/source/blender/editors/space_time/space_time.c
index c5ac67a..91a0970 100644
--- a/source/blender/editors/space_time/space_time.c
+++ b/source/blender/editors/space_time/space_time.c
@@ -58,6 +58,7 @@
 
 #include "UI_resources.h"
 #include "UI_view2d.h"
+#include "UI_interface.h"
 
 #include "ED_space_api.h"
 #include "ED_markers.h"
@@ -90,13 +91,12 @@ static void time_draw_sfra_efra(Scene *scene, View2D *v2d)
 	fdrawline((float)PEFRA, v2d->cur.ymin, (float)PEFRA, v2d->cur.ymax);
 }
 
-#define CACHE_DRAW_HEIGHT   3.0f
-
 static void time_draw_cache(SpaceTime *stime, Object *ob, Scene *scene)
 {
 	PTCacheID *pid;
 	ListBase pidlist;
 	SpaceTimeCache *stc = stime->caches.first;
+	const float cache_draw_height = (4.0f * UI_DPI_FAC * U.pixelsize);
 	float yoffs = 0.f;
 	
 	if (!(stime->cache_display & TIME_CACHE_DISPLAY) || (!ob))
@@ -172,7 +172,7 @@ static void time_draw_cache(SpaceTime *stime, Object *ob, Scene *scene)
 		
 		glPushMatrix();
 		glTranslatef(0.0, (float)V2D_SCROLL_HEIGHT + yoffs, 0.0);
-		glScalef(1.0, CACHE_DRAW_HEIGHT, 0.0);
+		glScalef(1.0, cache_draw_height, 0.0);
 		
 		switch (pid->type) {
 			case PTCACHE_TYPE_SOFTBODY:
@@ -230,7 +230,7 @@ static void time_draw_cache(SpaceTime *stime, Object *ob, Scene *scene)
 		
 		glPopMatrix();
 		
-		yoffs += CACHE_DRAW_HEIGHT;
+		yoffs += cache_draw_height;
 
 		stc = stc->next;
 	}




More information about the Bf-blender-cvs mailing list