diff options
author | Joshua Leung <aligorith@gmail.com> | 2008-12-21 14:56:42 +0300 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2008-12-21 14:56:42 +0300 |
commit | ad4d061091584dadcb2d2e8dd6ddf59af45b65f1 (patch) | |
tree | 8fc47cafe57a89daa844df29895993dd4d2b43ff /source/blender/editors/animation/anim_ops.c | |
parent | 841f376a1c2b5dfef22e02696d5ad2ba053ecfbe (diff) |
View2D - Vertical (within area) syncing for channel lists to stay in sync with the relevant keyframes...
I still need to work out how to get this to work correctly as soon as an Action Editor instance is created.
Diffstat (limited to 'source/blender/editors/animation/anim_ops.c')
-rw-r--r-- | source/blender/editors/animation/anim_ops.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/source/blender/editors/animation/anim_ops.c b/source/blender/editors/animation/anim_ops.c index 077dd110269..4321c89f730 100644 --- a/source/blender/editors/animation/anim_ops.c +++ b/source/blender/editors/animation/anim_ops.c @@ -228,11 +228,11 @@ static int previewrange_define_exec(bContext *C, wmOperator *op) float sfra, efra; int xmin, xmax; - /* convert min/max values from borderselect to region coordinates */ - xmin= RNA_int_get(op->ptr, "xmin")/* - ar->winrct.xmin*/; - xmax= RNA_int_get(op->ptr, "xmax")/* - ar->winrct.xmin*/; + /* get min/max values from border select rect (already in region coordinates, not screen) */ + xmin= RNA_int_get(op->ptr, "xmin"); + xmax= RNA_int_get(op->ptr, "xmax"); - /* convert min/max values to frames */ + /* convert min/max values to frames (i.e. region to 'tot' rect) */ UI_view2d_region_to_view(&ar->v2d, xmin, 0, &sfra, NULL); UI_view2d_region_to_view(&ar->v2d, xmax, 0, &efra, NULL); @@ -244,10 +244,10 @@ static int previewrange_define_exec(bContext *C, wmOperator *op) if (efra < 1) efra = 1.0f; if (efra < sfra) efra= sfra; - scene->r.psfra= (int)sfra; - scene->r.pefra= (int)efra; + scene->r.psfra= (int)floor(sfra + 0.5f); + scene->r.pefra= (int)floor(efra + 0.5f); - //BIF_undo_push("Clear Preview Range"); + //BIF_undo_push("Set Preview Range"); return OPERATOR_FINISHED; } |