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:
Diffstat (limited to 'source/blender/editors/interface/view2d_ops.c')
-rw-r--r--source/blender/editors/interface/view2d_ops.c76
1 files changed, 44 insertions, 32 deletions
diff --git a/source/blender/editors/interface/view2d_ops.c b/source/blender/editors/interface/view2d_ops.c
index defb7391bdf..23f8b4c9bc4 100644
--- a/source/blender/editors/interface/view2d_ops.c
+++ b/source/blender/editors/interface/view2d_ops.c
@@ -183,9 +183,10 @@ static void view_pan_apply(bContext *C, wmOperator *op)
{
v2dViewPanData *vpd = op->customdata;
- view_pan_apply_ex(C, vpd,
- RNA_int_get(op->ptr, "deltax"),
- RNA_int_get(op->ptr, "deltay"));
+ view_pan_apply_ex(
+ C, vpd,
+ RNA_int_get(op->ptr, "deltax"),
+ RNA_int_get(op->ptr, "deltay"));
}
@@ -736,9 +737,10 @@ static void view_zoomstep_apply_ex(
static void view_zoomstep_apply(bContext *C, wmOperator *op)
{
v2dViewZoomData *vzd = op->customdata;
- view_zoomstep_apply_ex(C, vzd, true,
- RNA_float_get(op->ptr, "zoomfacx"),
- RNA_float_get(op->ptr, "zoomfacy"));
+ view_zoomstep_apply_ex(
+ C, vzd, true,
+ RNA_float_get(op->ptr, "zoomfacx"),
+ RNA_float_get(op->ptr, "zoomfacy"));
}
/* --------------- Individual Operators ------------------- */
@@ -791,9 +793,10 @@ static int view_zoomin_invoke(bContext *C, wmOperator *op, const wmEvent *event)
ARegion *ar = CTX_wm_region(C);
/* store initial mouse position (in view space) */
- UI_view2d_region_to_view(&ar->v2d,
- event->mval[0], event->mval[1],
- &vzd->mx_2d, &vzd->my_2d);
+ UI_view2d_region_to_view(
+ &ar->v2d,
+ event->mval[0], event->mval[1],
+ &vzd->mx_2d, &vzd->my_2d);
}
return view_zoomin_exec(C, op);
@@ -856,9 +859,10 @@ static int view_zoomout_invoke(bContext *C, wmOperator *op, const wmEvent *event
ARegion *ar = CTX_wm_region(C);
/* store initial mouse position (in view space) */
- UI_view2d_region_to_view(&ar->v2d,
- event->mval[0], event->mval[1],
- &vzd->mx_2d, &vzd->my_2d);
+ UI_view2d_region_to_view(
+ &ar->v2d,
+ event->mval[0], event->mval[1],
+ &vzd->mx_2d, &vzd->my_2d);
}
return view_zoomout_exec(C, op);
@@ -1066,9 +1070,10 @@ static int view_zoomdrag_invoke(bContext *C, wmOperator *op, const wmEvent *even
ARegion *ar = CTX_wm_region(C);
/* store initial mouse position (in view space) */
- UI_view2d_region_to_view(&ar->v2d,
- event->mval[0], event->mval[1],
- &vzd->mx_2d, &vzd->my_2d);
+ UI_view2d_region_to_view(
+ &ar->v2d,
+ event->mval[0], event->mval[1],
+ &vzd->mx_2d, &vzd->my_2d);
}
if (v2d->keepofs & V2D_LOCKOFS_X)
@@ -1355,9 +1360,10 @@ static int view2d_ndof_invoke(bContext *C, wmOperator *op, const wmEvent *event)
vzd = op->customdata;
- view_zoomstep_apply_ex(C, vzd, false,
- do_zoom_xy[0] ? zoom_factor : 0.0f,
- do_zoom_xy[1] ? zoom_factor : 0.0f);
+ view_zoomstep_apply_ex(
+ C, vzd, false,
+ do_zoom_xy[0] ? zoom_factor : 0.0f,
+ do_zoom_xy[1] ? zoom_factor : 0.0f);
view_zoomstep_exit(op);
}
@@ -1402,14 +1408,18 @@ struct SmoothView2DStore {
*/
static float smooth_view_rect_to_fac(const rctf *rect_a, const rctf *rect_b)
{
- const float size_a[2] = {BLI_rctf_size_x(rect_a),
- BLI_rctf_size_y(rect_a)};
- const float size_b[2] = {BLI_rctf_size_x(rect_b),
- BLI_rctf_size_y(rect_b)};
- const float cent_a[2] = {BLI_rctf_cent_x(rect_a),
- BLI_rctf_cent_y(rect_a)};
- const float cent_b[2] = {BLI_rctf_cent_x(rect_b),
- BLI_rctf_cent_y(rect_b)};
+ const float size_a[2] = {
+ BLI_rctf_size_x(rect_a),
+ BLI_rctf_size_y(rect_a)};
+ const float size_b[2] = {
+ BLI_rctf_size_x(rect_b),
+ BLI_rctf_size_y(rect_b)};
+ const float cent_a[2] = {
+ BLI_rctf_cent_x(rect_a),
+ BLI_rctf_cent_y(rect_a)};
+ const float cent_b[2] = {
+ BLI_rctf_cent_x(rect_b),
+ BLI_rctf_cent_y(rect_b)};
float fac_max = 0.0f;
float tfac;
@@ -1724,9 +1734,10 @@ static void scroller_activate_init(bContext *C, wmOperator *op, const wmEvent *e
vsm->fac_round = (BLI_rctf_size_x(&v2d->cur)) / (float)(BLI_rcti_size_x(&ar->winrct) + 1);
/* get 'zone' (i.e. which part of scroller is activated) */
- vsm->zone = mouse_in_scroller_handle(event->mval[0],
- v2d->hor.xmin, v2d->hor.xmax,
- scrollers->hor_min, scrollers->hor_max);
+ vsm->zone = mouse_in_scroller_handle(
+ event->mval[0],
+ v2d->hor.xmin, v2d->hor.xmax,
+ scrollers->hor_min, scrollers->hor_max);
if ((v2d->keepzoom & V2D_LOCKZOOM_X) && ELEM(vsm->zone, SCROLLHANDLE_MIN, SCROLLHANDLE_MAX)) {
/* default to scroll, as handles not usable */
@@ -1745,9 +1756,10 @@ static void scroller_activate_init(bContext *C, wmOperator *op, const wmEvent *e
vsm->fac_round = (BLI_rctf_size_y(&v2d->cur)) / (float)(BLI_rcti_size_y(&ar->winrct) + 1);
/* get 'zone' (i.e. which part of scroller is activated) */
- vsm->zone = mouse_in_scroller_handle(event->mval[1],
- v2d->vert.ymin, v2d->vert.ymax,
- scrollers->vert_min, scrollers->vert_max);
+ vsm->zone = mouse_in_scroller_handle(
+ event->mval[1],
+ v2d->vert.ymin, v2d->vert.ymax,
+ scrollers->vert_min, scrollers->vert_max);
if ((v2d->keepzoom & V2D_LOCKZOOM_Y) && ELEM(vsm->zone, SCROLLHANDLE_MIN, SCROLLHANDLE_MAX)) {
/* default to scroll, as handles not usable */