diff options
author | Germano Cavalcante <germano.costa@ig.com.br> | 2022-08-26 19:17:30 +0300 |
---|---|---|
committer | Germano Cavalcante <germano.costa@ig.com.br> | 2022-08-26 19:17:51 +0300 |
commit | 3c060b2216b868eec99bb0acb3534c3780344774 (patch) | |
tree | 61bf8bc07b207276e7acec7e00e341c4801b2b0d /source/blender/editors/transform/transform.h | |
parent | cc9c4e274440e538a0d0f1988dfef5cff13f6f29 (diff) |
Fix T100633: Node Editor: Edge scrolling breaks node snapping
The view offset, calculated by the Edge Pan system, only affects the
position of the nodes, but forget to update:
- snapping data
- final value of transform
- values used for custom drawing
Therefore, to avoid having to update a lot of scattered data, the
`transformViewUpdate` utility has been implemented to recalculate input
values when the view changes.
This utility does more than is necessary to fix the bug, but with that,
it can work in any situation.
Diffstat (limited to 'source/blender/editors/transform/transform.h')
-rw-r--r-- | source/blender/editors/transform/transform.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/source/blender/editors/transform/transform.h b/source/blender/editors/transform/transform.h index b84ce83500f..0429e37a077 100644 --- a/source/blender/editors/transform/transform.h +++ b/source/blender/editors/transform/transform.h @@ -355,10 +355,12 @@ typedef struct MouseInput { /** Initial mouse position. */ int imval[2]; - bool precision; - float precision_factor; + float imval_unproj[3]; float center[2]; float factor; + float precision_factor; + bool precision; + /** Additional data, if needed by the particular function. */ void *data; @@ -758,6 +760,7 @@ void applyMouseInput(struct TransInfo *t, struct MouseInput *mi, const int mval[2], float output[3]); +void transform_input_update(TransInfo *t, const float fac); void setCustomPoints(TransInfo *t, MouseInput *mi, const int start[2], const int end[2]); void setCustomPointsFromDirection(TransInfo *t, MouseInput *mi, const float dir[2]); @@ -806,6 +809,7 @@ void calculateCenter2D(TransInfo *t); void calculateCenterLocal(TransInfo *t, const float center_global[3]); void calculateCenter(TransInfo *t); +void tranformViewUpdate(TransInfo *t); /* API functions for getting center points */ void calculateCenterBound(TransInfo *t, float r_center[3]); |