Transform: Move enum SnapSelect to ED_transform_snap_object_context

This commit is contained in:
mano-wii
2017-08-16 14:16:30 -03:00
parent a773ac4bda
commit 916b9b311f
3 changed files with 10 additions and 14 deletions

View File

@@ -159,12 +159,6 @@ void BIF_draw_manipulator(const struct bContext *C);
/* Snapping */
typedef enum SnapSelect {
SNAP_ALL = 0,
SNAP_NOT_SELECTED = 1,
SNAP_NOT_ACTIVE = 2,
} SnapSelect;
#define SNAP_MIN_DISTANCE 30
bool peelObjectsTransform(
@@ -187,11 +181,7 @@ bool snapObjectsTransform(
/* return args */
float r_loc[3], float r_no[3]);
bool snapNodesTransform(
struct TransInfo *t, const int mval[2], SnapSelect snap_select,
/* return args */
float r_loc[2], float *r_dist_px, char *r_node_border);
bool snapNodesContext(
struct bContext *C, const int mval[2], SnapSelect snap_select,
struct TransInfo *t, const int mval[2],
/* return args */
float r_loc[2], float *r_dist_px, char *r_node_border);

View File

@@ -40,6 +40,12 @@ struct View3D;
/* ED_transform_snap_object_*** API */
typedef enum SnapSelect {
SNAP_ALL = 0,
SNAP_NOT_SELECTED = 1,
SNAP_NOT_ACTIVE = 2,
} SnapSelect;
/** used for storing multiple hits */
struct SnapObjectHitDepth {
struct SnapObjectHitDepth *next, *prev;

View File

@@ -1017,7 +1017,7 @@ static void CalcSnapGeometry(TransInfo *t, float *UNUSED(vec))
float dist_px = SNAP_MIN_DISTANCE; // Use a user defined value here
char node_border;
if (snapNodesTransform(t, t->mval, t->tsnap.modeSelect, loc, &dist_px, &node_border)) {
if (snapNodesTransform(t, t->mval, loc, &dist_px, &node_border)) {
copy_v2_v2(t->tsnap.snapPoint, loc);
t->tsnap.snapNodeBorder = node_border;
@@ -1413,11 +1413,11 @@ static bool snapNodes(
}
bool snapNodesTransform(
TransInfo *t, const int mval[2], SnapSelect snap_select,
TransInfo *t, const int mval[2],
float r_loc[2], float *r_dist_px, char *r_node_border)
{
return snapNodes(
t->settings, t->sa->spacedata.first, t->ar, mval, snap_select,
t->settings, t->sa->spacedata.first, t->ar, mval, t->tsnap.modeSelect,
r_loc, r_dist_px, r_node_border);
}