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:
authorCampbell Barton <ideasman42@gmail.com>2012-08-09 00:38:55 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-08-09 00:38:55 +0400
commit5e0f254afa8caed1febbe02130cc313a53149efe (patch)
tree859b5590307db3310e070b258c04697dabaac2a1 /source/blender/editors/animation/anim_ops.c
parent6cfb7f50d2856068f74125321a348e43b7c9c3d4 (diff)
utility functions for getting/setting rectangles for operators.
Diffstat (limited to 'source/blender/editors/animation/anim_ops.c')
-rw-r--r--source/blender/editors/animation/anim_ops.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/source/blender/editors/animation/anim_ops.c b/source/blender/editors/animation/anim_ops.c
index 1ab6247728a..e24a4d49a05 100644
--- a/source/blender/editors/animation/anim_ops.c
+++ b/source/blender/editors/animation/anim_ops.c
@@ -185,15 +185,14 @@ static int previewrange_define_exec(bContext *C, wmOperator *op)
Scene *scene = CTX_data_scene(C);
ARegion *ar = CTX_wm_region(C);
float sfra, efra;
- int xmin, xmax;
+ rcti rect;
/* 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");
+ WM_operator_properties_border_to_rcti(op, &rect);
/* 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);
+ UI_view2d_region_to_view(&ar->v2d, rect.xmin, 0, &sfra, NULL);
+ UI_view2d_region_to_view(&ar->v2d, rect.xmax, 0, &efra, NULL);
/* set start/end frames for preview-range
* - must clamp within allowable limits
@@ -232,12 +231,11 @@ static void ANIM_OT_previewrange_set(wmOperatorType *ot)
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
/* rna */
- /* used to define frame range */
- RNA_def_int(ot->srna, "xmin", 0, INT_MIN, INT_MAX, "X Min", "", INT_MIN, INT_MAX);
- RNA_def_int(ot->srna, "xmax", 0, INT_MIN, INT_MAX, "X Max", "", INT_MIN, INT_MAX);
- /* these are not used, but are needed by borderselect gesture operator stuff */
- RNA_def_int(ot->srna, "ymin", 0, INT_MIN, INT_MAX, "Y Min", "", INT_MIN, INT_MAX);
- RNA_def_int(ot->srna, "ymax", 0, INT_MIN, INT_MAX, "Y Max", "", INT_MIN, INT_MAX);
+ /* used to define frame range.
+ *
+ * note: border Y values are not used,
+ * but are needed by borderselect gesture operator stuff */
+ WM_operator_properties_border(ot);
}
/* ****************** clear preview range operator ****************************/