diff options
author | Campbell Barton <ideasman42@gmail.com> | 2016-05-31 16:56:59 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2016-05-31 17:01:17 +0300 |
commit | a0e91ef04090790dcd683d86d3cadb9aff0062e7 (patch) | |
tree | 48941a69ffe73fdf8b292e8463581cf851cf297e /source/blender/editors/transform/transform.h | |
parent | d5220d23f976d14350d5d76f7cb97d4fef8e977d (diff) |
Fix T48554: Absolute grid snap fails w/ cursor pivot
Use center of selection when using absolute grid snapping and cursor pivot.
Diffstat (limited to 'source/blender/editors/transform/transform.h')
-rw-r--r-- | source/blender/editors/transform/transform.h | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/source/blender/editors/transform/transform.h b/source/blender/editors/transform/transform.h index 11151a9c65a..0e0d085bf6f 100644 --- a/source/blender/editors/transform/transform.h +++ b/source/blender/editors/transform/transform.h @@ -369,6 +369,11 @@ typedef struct TransCustomData { unsigned int use_free : 1; } TransCustomData; +typedef struct TransCenterData { + float local[3], global[3]; + unsigned int is_set : 1; +} TransCenterData; + typedef struct TransInfo { int mode; /* current mode */ int flag; /* generic flags for special behaviors */ @@ -396,6 +401,9 @@ typedef struct TransInfo { float center[3]; /* center of transformation (in local-space) */ float center_global[3]; /* center of transformation (in global-space) */ float center2d[2]; /* center in screen coordinates */ + /* Lazy initialize center data for when we need other center values. + * V3D_AROUND_ACTIVE + 1 (static assert checks this) */ + TransCenterData center_cache[5]; short idx_max; /* maximum index on the input vector */ float snap[3]; /* Snapping Gears */ float snap_spatial[3]; /* Spatial snapping gears(even when rotating, scaling... etc) */ @@ -742,8 +750,11 @@ void restoreTransObjects(TransInfo *t); void recalcData(TransInfo *t); void calculateCenter2D(TransInfo *t); -void calculateCenterGlobal(TransInfo *t); +void calculateCenterGlobal( + TransInfo *t, const float center_local[3], + float r_center_global[3]); +const TransCenterData *transformCenter_from_type(TransInfo *t, int around); void calculateCenter(TransInfo *t); /* API functions for getting center points */ |