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:
authorJoshua Leung <aligorith@gmail.com>2010-01-30 07:43:36 +0300
committerJoshua Leung <aligorith@gmail.com>2010-01-30 07:43:36 +0300
commite1fdf7fc58573de84fba5514bcdef1749bb61d16 (patch)
tree301a9bfee9018170f18327e86f6a1e460123c335 /source/blender/editors/space_graph
parentd86a9da07ca7901c1984c79b420cb87b363cbafa (diff)
View2D/TimeCode Drawing:
This commit introduces a few cleanups and tweaks to the way that timecodes (i.e. the timing indications used instead of frame numbers) get displayed. 1. Custom Spacing of TimeCodes/Gridlines Made the minimum number of pixels between gridlines/timecode indications a user-preference, instead of being a hardcoded constant. This allows to set the spacing tighter/looser than the defaults, and is also used for the other changes. 2. Default timecode display style, (now named 'minimal') uses '+' as the delimeter for the sub-second frames. This hopefully makes it a bit clearer what those values represent, as opposed to the '!', which can sometimes look too much like a colon. 3. Added various timecode display styles as user-preference. - These include always displaying full SMPTE, to showing milliseconds instead of frams for sub-second times, and also an option to just show the times as seconds only. - When changing the timecode style, the spacing setting is automatically modified so that the timecodes are spaced far apart enough so that they won't clash (under most circumstances). This automatic modification is only done if the spacing is too tight for the style being set. 4. Unified the code for generating timecode strings between the View2D scrollbar drawing and the current frame indicator drawing.
Diffstat (limited to 'source/blender/editors/space_graph')
-rw-r--r--source/blender/editors/space_graph/graph_draw.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/source/blender/editors/space_graph/graph_draw.c b/source/blender/editors/space_graph/graph_draw.c
index b52fc1b9e6a..8642c2d15c5 100644
--- a/source/blender/editors/space_graph/graph_draw.c
+++ b/source/blender/editors/space_graph/graph_draw.c
@@ -491,11 +491,6 @@ static void draw_fcurve_samples (bAnimContext *ac, SpaceIpo *sipo, ARegion *ar,
/* Curve ---------------- */
-/* minimum pixels per gridstep
- * XXX: defined in view2d.c - must keep these in sync or relocate to View2D header!
- */
-#define MINGRIDSTEP 35
-
/* helper func - just draw the F-Curve by sampling the visible region (for drawing curves with modifiers) */
static void draw_fcurve_curve (bAnimContext *ac, ID *id, FCurve *fcu, SpaceIpo *sipo, View2D *v2d, View2DGrid *grid)
{
@@ -523,10 +518,10 @@ static void draw_fcurve_curve (bAnimContext *ac, ID *id, FCurve *fcu, SpaceIpo *
* loop (i.e. too close to FLT_EPSILON), fall back to default of 0.001
*/
/* grid->dx is the first float in View2DGrid struct, so just cast to float pointer, and use it
- * It represents the number of 'frames' between gridlines, but we divide by MINGRIDSTEP to get pixels-steps
+ * It represents the number of 'frames' between gridlines, but we divide by U.v2d_min_gridsize to get pixels-steps
*/
// TODO: perhaps we should have 1.0 frames as upper limit so that curves don't get too distorted?
- samplefreq= *((float *)grid) / MINGRIDSTEP;
+ samplefreq= *((float *)grid) / U.v2d_min_gridsize;
if (IS_EQ(samplefreq, 0)) samplefreq= 0.001f;