[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [53139] trunk/blender/source/blender/ editors/space_clip: Made motion tracking data aware of DPI in clip editor.

Sergey Sharybin sergey.vfx at gmail.com
Tue Dec 18 18:47:05 CET 2012


Revision: 53139
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=53139
Author:   nazgul
Date:     2012-12-18 17:47:05 +0000 (Tue, 18 Dec 2012)
Log Message:
-----------
Made motion tracking data aware of DPI in clip editor.

Also synchronized tracking dopesheet channels height/spacing with fcurve dopesheet.

Modified Paths:
--------------
    trunk/blender/source/blender/editors/space_clip/clip_draw.c
    trunk/blender/source/blender/editors/space_clip/clip_intern.h

Modified: trunk/blender/source/blender/editors/space_clip/clip_draw.c
===================================================================
--- trunk/blender/source/blender/editors/space_clip/clip_draw.c	2012-12-18 17:46:59 UTC (rev 53138)
+++ trunk/blender/source/blender/editors/space_clip/clip_draw.c	2012-12-18 17:47:05 UTC (rev 53139)
@@ -103,11 +103,11 @@
 	if (width == 1) {
 		glBegin(GL_LINES);
 		glVertex2i(x, 0);
-		glVertex2i(x, height);
+		glVertex2i(x, height * UI_DPI_FAC);
 		glEnd();
 	}
 	else {
-		glRecti(x, 0, x + width, height);
+		glRecti(x, 0, x + width, height * UI_DPI_FAC);
 	}
 }
 
@@ -125,7 +125,7 @@
 
 	/* cache background */
 	glColor4ub(128, 128, 255, 64);
-	glRecti(0, 0, ar->winx, 8);
+	glRecti(0, 0, ar->winx, 8 * UI_DPI_FAC);
 
 	/* cached segments -- could be usefu lto debug caching strategies */
 	BKE_movieclip_get_cache_segments(clip, &sc->user, &totseg, &points);
@@ -138,7 +138,7 @@
 			x1 = (points[a * 2] - sfra) / (efra - sfra + 1) * ar->winx;
 			x2 = (points[a * 2 + 1] - sfra + 1) / (efra - sfra + 1) * ar->winx;
 
-			glRecti(x1, 0, x2, 8);
+			glRecti(x1, 0, x2, 8 * UI_DPI_FAC);
 		}
 	}
 
@@ -175,7 +175,7 @@
 				else
 					glColor4ub(255, 255, 0, 96);
 
-				glRecti((i - sfra + clip->start_frame - 1) * framelen, 0, (i - sfra + clip->start_frame) * framelen, 4);
+				glRecti((i - sfra + clip->start_frame - 1) * framelen, 0, (i - sfra + clip->start_frame) * framelen, 4 * UI_DPI_FAC);
 			}
 		}
 	}
@@ -203,7 +203,7 @@
 			}
 
 			if (!ok)
-				glRecti((i - sfra + clip->start_frame - 1) * framelen, 0, (i - sfra + clip->start_frame) * framelen, 8);
+				glRecti((i - sfra + clip->start_frame - 1) * framelen, 0, (i - sfra + clip->start_frame) * framelen, 8 * UI_DPI_FAC);
 		}
 	}
 
@@ -213,9 +213,9 @@
 	x = (sc->user.framenr - sfra) / (efra - sfra + 1) * ar->winx;
 
 	UI_ThemeColor(TH_CFRAME);
-	glRecti(x, 0, x + ceilf(framelen), 8);
+	glRecti(x, 0, x + ceilf(framelen), 8 * UI_DPI_FAC);
 
-	clip_draw_curfra_label(sc->user.framenr, x, 8.0f);
+	clip_draw_curfra_label(sc->user.framenr, x, 8.0f * UI_DPI_FAC);
 
 	/* solver keyframes */
 	glColor4ub(175, 255, 0, 255);
@@ -796,11 +796,11 @@
 	dy = 6.0f / height / sc->zoom;
 
 	side = get_shortest_pattern_side(marker);
-	patdx = min_ff(dx * 2.0f / 3.0f, side / 6.0f);
-	patdy = min_ff(dy * 2.0f / 3.0f, side * width / height / 6.0f);
+	patdx = min_ff(dx * 2.0f / 3.0f, side / 6.0f) * UI_DPI_FAC;
+	patdy = min_ff(dy * 2.0f / 3.0f, side * width / height / 6.0f) * UI_DPI_FAC;
 
-	searchdx = min_ff(dx, (marker->search_max[0] - marker->search_min[0]) / 6.0f);
-	searchdy = min_ff(dy, (marker->search_max[1] - marker->search_min[1]) / 6.0f);
+	searchdx = min_ff(dx, (marker->search_max[0] - marker->search_min[0]) / 6.0f) * UI_DPI_FAC;
+	searchdy = min_ff(dy, (marker->search_max[1] - marker->search_min[1]) / 6.0f) * UI_DPI_FAC;
 
 	px[0] = 1.0f / sc->zoom / width / sc->scale;
 	px[1] = 1.0f / sc->zoom / height / sc->scale;

Modified: trunk/blender/source/blender/editors/space_clip/clip_intern.h
===================================================================
--- trunk/blender/source/blender/editors/space_clip/clip_intern.h	2012-12-18 17:46:59 UTC (rev 53138)
+++ trunk/blender/source/blender/editors/space_clip/clip_intern.h	2012-12-18 17:47:05 UTC (rev 53139)
@@ -43,10 +43,10 @@
 struct wmOperatorType;
 
 /* channel heights */
-#define CHANNEL_FIRST           -UI_UNIT_Y
-#define CHANNEL_HEIGHT          UI_UNIT_Y
-#define CHANNEL_HEIGHT_HALF     (UI_UNIT_Y / 2.0f)
-#define CHANNEL_SKIP            2
+#define CHANNEL_FIRST           (-0.8f * U.widget_unit)
+#define CHANNEL_HEIGHT          (0.8f * U.widget_unit)
+#define CHANNEL_HEIGHT_HALF     (0.4f * U.widget_unit)
+#define CHANNEL_SKIP            (0.1f * U.widget_unit)
 #define CHANNEL_STEP            (CHANNEL_HEIGHT + CHANNEL_SKIP)
 
 #define CHANNEL_PAD             4
@@ -54,7 +54,7 @@
 /* extra padding for lengths (to go under scrollers) */
 #define EXTRA_SCROLL_PAD        100.0f
 
-#define STRIP_HEIGHT_HALF       5
+#define STRIP_HEIGHT_HALF       (0.25 * UI_UNIT_Y)
 
 /* internal exports only */
 




More information about the Bf-blender-cvs mailing list