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>2018-08-09 16:10:54 +0300
committerCampbell Barton <ideasman42@gmail.com>2018-08-10 01:14:22 +0300
commit3daf5cc1ceb4854ba7ca481b9e2f1a5ed19bd2cb (patch)
tree5c1b49497d66ec2f6fb010e9ff60d29bdcde106f /source/blender/editors/gizmo_library/gizmo_types
parenteb7b450c0c65388758fcec5764a759d3d347c314 (diff)
Gizmo: 2d select now takes region coords
Was taking an event, when only the region coords are needed.
Diffstat (limited to 'source/blender/editors/gizmo_library/gizmo_types')
-rw-r--r--source/blender/editors/gizmo_library/gizmo_types/arrow2d_gizmo.c6
-rw-r--r--source/blender/editors/gizmo_library/gizmo_types/button2d_gizmo.c6
-rw-r--r--source/blender/editors/gizmo_library/gizmo_types/cage2d_gizmo.c4
-rw-r--r--source/blender/editors/gizmo_library/gizmo_types/grab3d_gizmo.c4
4 files changed, 10 insertions, 10 deletions
diff --git a/source/blender/editors/gizmo_library/gizmo_types/arrow2d_gizmo.c b/source/blender/editors/gizmo_library/gizmo_types/arrow2d_gizmo.c
index cb8e2a90b07..953e763a33c 100644
--- a/source/blender/editors/gizmo_library/gizmo_types/arrow2d_gizmo.c
+++ b/source/blender/editors/gizmo_library/gizmo_types/arrow2d_gizmo.c
@@ -140,15 +140,15 @@ static int gizmo_arrow2d_invoke(
}
static int gizmo_arrow2d_test_select(
- bContext *UNUSED(C), wmGizmo *gz, const wmEvent *event)
+ bContext *UNUSED(C), wmGizmo *gz, const int mval[2])
{
- const float mval[2] = {event->mval[0], event->mval[1]};
+ const float mval_fl[2] = {UNPACK2(mval)};
const float arrow_length = RNA_float_get(gz->ptr, "length");
const float arrow_angle = RNA_float_get(gz->ptr, "angle");
const float line_len = arrow_length * gz->scale_final;
float mval_local[2];
- copy_v2_v2(mval_local, mval);
+ copy_v2_v2(mval_local, mval_fl);
sub_v2_v2(mval_local, gz->matrix_basis[3]);
float line[2][2];
diff --git a/source/blender/editors/gizmo_library/gizmo_types/button2d_gizmo.c b/source/blender/editors/gizmo_library/gizmo_types/button2d_gizmo.c
index d976adc06bf..dfc0dcd791c 100644
--- a/source/blender/editors/gizmo_library/gizmo_types/button2d_gizmo.c
+++ b/source/blender/editors/gizmo_library/gizmo_types/button2d_gizmo.c
@@ -232,20 +232,20 @@ static void gizmo_button2d_draw(const bContext *C, wmGizmo *gz)
}
static int gizmo_button2d_test_select(
- bContext *C, wmGizmo *gz, const wmEvent *event)
+ bContext *C, wmGizmo *gz, const int mval[2])
{
float point_local[2];
if (0) {
/* correct, but unnecessarily slow. */
if (gizmo_window_project_2d(
- C, gz, (const float[2]){UNPACK2(event->mval)}, 2, true, point_local) == false)
+ C, gz, (const float[2]){UNPACK2(mval)}, 2, true, point_local) == false)
{
return -1;
}
}
else {
- copy_v2_v2(point_local, (float[2]){UNPACK2(event->mval)});
+ copy_v2_v2(point_local, (float[2]){UNPACK2(mval)});
sub_v2_v2(point_local, gz->matrix_basis[3]);
mul_v2_fl(point_local, 1.0f / (gz->scale_basis * UI_DPI_FAC));
}
diff --git a/source/blender/editors/gizmo_library/gizmo_types/cage2d_gizmo.c b/source/blender/editors/gizmo_library/gizmo_types/cage2d_gizmo.c
index 2869b93a790..bb9cac595be 100644
--- a/source/blender/editors/gizmo_library/gizmo_types/cage2d_gizmo.c
+++ b/source/blender/editors/gizmo_library/gizmo_types/cage2d_gizmo.c
@@ -718,7 +718,7 @@ static int gizmo_cage2d_get_cursor(wmGizmo *gz)
}
static int gizmo_cage2d_test_select(
- bContext *C, wmGizmo *gz, const wmEvent *event)
+ bContext *C, wmGizmo *gz, const int mval[2])
{
float point_local[2];
float dims[2];
@@ -726,7 +726,7 @@ static int gizmo_cage2d_test_select(
const float size_real[2] = {dims[0] / 2.0f, dims[1] / 2.0f};
if (gizmo_window_project_2d(
- C, gz, (const float[2]){UNPACK2(event->mval)}, 2, true, point_local) == false)
+ C, gz, (const float[2]){UNPACK2(mval)}, 2, true, point_local) == false)
{
return -1;
}
diff --git a/source/blender/editors/gizmo_library/gizmo_types/grab3d_gizmo.c b/source/blender/editors/gizmo_library/gizmo_types/grab3d_gizmo.c
index 8d4db81c11f..fcbd333078d 100644
--- a/source/blender/editors/gizmo_library/gizmo_types/grab3d_gizmo.c
+++ b/source/blender/editors/gizmo_library/gizmo_types/grab3d_gizmo.c
@@ -293,12 +293,12 @@ static int gizmo_grab_invoke(
static int gizmo_grab_test_select(
- bContext *C, wmGizmo *gz, const wmEvent *event)
+ bContext *C, wmGizmo *gz, const int mval[2])
{
float point_local[2];
if (gizmo_window_project_2d(
- C, gz, (const float[2]){UNPACK2(event->mval)}, 2, true, point_local) == false)
+ C, gz, (const float[2]){UNPACK2(mval)}, 2, true, point_local) == false)
{
return -1;
}