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>2014-05-08 09:43:11 +0400
committerJoshua Leung <aligorith@gmail.com>2014-05-08 09:43:11 +0400
commitd20c9e491c4f158330029c6cccfc50216843fbb5 (patch)
tree412e19f5c1b42faee866ddb6e04242e841565a53 /source/blender/editors/space_graph
parent88e5705a3fe04cf9e83baa4007c06e35d19156ae (diff)
Bugfix: "Lock time to frame range" didn't work in the Graph Editor
This uses a different operator than the other time editors (as it needs to support the setting of the value-cursor too), so the changes here didn't get propagated through.
Diffstat (limited to 'source/blender/editors/space_graph')
-rw-r--r--source/blender/editors/space_graph/graph_ops.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/source/blender/editors/space_graph/graph_ops.c b/source/blender/editors/space_graph/graph_ops.c
index eacbca38305..cfd82b67289 100644
--- a/source/blender/editors/space_graph/graph_ops.c
+++ b/source/blender/editors/space_graph/graph_ops.c
@@ -110,19 +110,27 @@ static int graphview_cursor_exec(bContext *C, wmOperator *op)
/* set the operator properties from the initial event */
static void graphview_cursor_setprops(bContext *C, wmOperator *op, const wmEvent *event)
{
+ Scene *scene = CTX_data_scene(C);
ARegion *ar = CTX_wm_region(C);
float viewx, viewy;
-
+ int frame;
+
/* abort if not active region (should not really be possible) */
if (ar == NULL)
return;
-
+
/* convert from region coordinates to View2D 'tot' space */
UI_view2d_region_to_view(&ar->v2d, event->mval[0], event->mval[1], &viewx, &viewy);
- /* store the values in the operator properties */
/* frame is rounded to the nearest int, since frames are ints */
- RNA_int_set(op->ptr, "frame", iroundf(viewx));
+ frame = iroundf(viewx);
+
+ if (scene->r.flag & SCER_LOCK_FRAME_SELECTION) {
+ CLAMP(frame, PSFRA, PEFRA);
+ }
+
+ /* store the values in the operator properties */
+ RNA_int_set(op->ptr, "frame", frame);
RNA_float_set(op->ptr, "value", viewy);
}