diff options
author | Germano Cavalcante <germano.costa@ig.com.br> | 2021-02-05 17:01:30 +0300 |
---|---|---|
committer | Germano Cavalcante <germano.costa@ig.com.br> | 2021-02-08 15:54:54 +0300 |
commit | be60b3b23984ff7a9b973a37800522e4b5e7918f (patch) | |
tree | 4bef4e93dc7c23e44d4fa0a7871f95f3a6e37f9a /source/blender/editors/transform/transform.h | |
parent | bc56c127704f937d7fdfee082975bc0fa01f4b52 (diff) |
Transform: Grid snap target refactor
The code takes many turns to get a suitable "target" for the snap to grid.
Perhaps there were other reasons awaited for `transformCenter_from_type`
and `TransCenterData center_cache[5]`.
But since nothing is defined, it is better to simplify the code.
No user functional changes
Diffstat (limited to 'source/blender/editors/transform/transform.h')
-rw-r--r-- | source/blender/editors/transform/transform.h | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/source/blender/editors/transform/transform.h b/source/blender/editors/transform/transform.h index 72f43a14b11..9ee0aa1d6da 100644 --- a/source/blender/editors/transform/transform.h +++ b/source/blender/editors/transform/transform.h @@ -166,8 +166,10 @@ typedef enum { typedef enum { SNAP_FORCED = 1 << 0, TARGET_INIT = 1 << 1, - POINT_INIT = 1 << 2, - MULTI_POINTS = 1 << 3, + /* Special flag for snap to grid. */ + TARGET_GRID_INIT = 1 << 2, + POINT_INIT = 1 << 3, + MULTI_POINTS = 1 << 4, } eTSnap; /** #TransCon.mode, #TransInfo.con.mode */ @@ -310,6 +312,7 @@ typedef struct TransSnap { float snapPoint[3]; /** to this point (in global-space). */ float snapTarget[3]; + float snapTargetGrid[3]; float snapNormal[3]; char snapNodeBorder; ListBase points; @@ -539,9 +542,6 @@ typedef struct TransInfo { float center_global[3]; /** center in screen coordinates. */ float center2d[2]; - /* Lazy initialize center data for when we need other center values. - * V3D_AROUND_ACTIVE + 1 (static assert checks this) */ - TransCenterData center_cache[5]; /** maximum index on the input vector. */ short idx_max; /** Snapping Gears. */ @@ -764,7 +764,6 @@ void recalcData(TransInfo *t); void calculateCenter2D(TransInfo *t); void calculateCenterLocal(TransInfo *t, const float center_global[3]); -const TransCenterData *transformCenter_from_type(TransInfo *t, int around); void calculateCenter(TransInfo *t); /* API functions for getting center points */ |