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-07-27 02:41:40 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-07-27 02:41:40 +0400
commitff078d309e65d2383fa0829954c724fc49189492 (patch)
treee383ad5f7fa69eba20adfa691f7a90f49925c64d /source/blender/editors/mask/mask_add.c
parentee572a9642d5360f0ba852c17cc345f21ad1f985 (diff)
change clip utility function arguments to take space data and region rather then the context.
this allows a fix to be applied that corrects the helper line in the image view when transforming a mask.
Diffstat (limited to 'source/blender/editors/mask/mask_add.c')
-rw-r--r--source/blender/editors/mask/mask_add.c24
1 files changed, 18 insertions, 6 deletions
diff --git a/source/blender/editors/mask/mask_add.c b/source/blender/editors/mask/mask_add.c
index c9f6dc0c5fb..48c81894b55 100644
--- a/source/blender/editors/mask/mask_add.c
+++ b/source/blender/editors/mask/mask_add.c
@@ -38,6 +38,7 @@
#include "BKE_mask.h"
#include "DNA_scene_types.h"
+#include "DNA_screen_types.h"
#include "DNA_mask_types.h"
#include "DNA_object_types.h" /* SELECT */
@@ -57,6 +58,9 @@ static int find_nearest_diff_point(const bContext *C, Mask *mask, const float no
float *u_r, float tangent[2],
const short use_deform)
{
+ ScrArea *sa = CTX_wm_area(C);
+ ARegion *ar = CTX_wm_region(C);
+
MaskLayer *masklay, *point_masklay;
MaskSpline *point_spline;
MaskSplinePoint *point = NULL;
@@ -65,9 +69,9 @@ static int find_nearest_diff_point(const bContext *C, Mask *mask, const float no
float u;
float scalex, scaley, aspx, aspy;
- ED_mask_size(C, &width, &height);
- ED_mask_aspect(C, &aspx, &aspy);
- ED_mask_pixelspace_factor(C, &scalex, &scaley);
+ ED_mask_get_size(sa, &width, &height);
+ ED_mask_get_aspect(sa, ar, &aspx, &aspy);
+ ED_mask_pixelspace_factor(sa, ar, &scalex, &scaley);
co[0] = normal_co[0] * scalex;
co[1] = normal_co[1] * scaley;
@@ -180,6 +184,8 @@ static void setup_vertex_point(const bContext *C, Mask *mask, MaskSpline *spline
const float point_co[2], const float tangent[2], const float u,
MaskSplinePoint *reference_point, const short reference_adjacent)
{
+ ScrArea *sa = CTX_wm_area(C);
+
MaskSplinePoint *prev_point = NULL;
MaskSplinePoint *next_point = NULL;
BezTriple *bezt;
@@ -190,7 +196,7 @@ static void setup_vertex_point(const bContext *C, Mask *mask, MaskSpline *spline
copy_v2_v2(co, point_co);
co[2] = 0.0f;
- ED_mask_size(C, &width, &height);
+ ED_mask_get_size(sa, &width, &height);
/* point coordinate */
bezt = &new_point->bezt;
@@ -610,9 +616,12 @@ static int add_vertex_exec(bContext *C, wmOperator *op)
static int add_vertex_invoke(bContext *C, wmOperator *op, wmEvent *event)
{
+ ScrArea *sa = CTX_wm_area(C);
+ ARegion *ar = CTX_wm_region(C);
+
float co[2];
- ED_mask_mouse_pos(C, event, co);
+ ED_mask_mouse_pos(sa, ar, event, co);
RNA_float_set_array(op->ptr, "location", co);
@@ -681,9 +690,12 @@ static int add_feather_vertex_exec(bContext *C, wmOperator *op)
static int add_feather_vertex_invoke(bContext *C, wmOperator *op, wmEvent *event)
{
+ ScrArea *sa = CTX_wm_area(C);
+ ARegion *ar = CTX_wm_region(C);
+
float co[2];
- ED_mask_mouse_pos(C, event, co);
+ ED_mask_mouse_pos(sa, ar, event, co);
RNA_float_set_array(op->ptr, "location", co);