Cleanup: de-duplicate comments & expand on why UV's are clipped

This commit is contained in:
Campbell Barton
2023-08-21 10:31:57 +10:00
parent 33a05725be
commit 1c7adc61ae
5 changed files with 11 additions and 14 deletions
@@ -486,6 +486,13 @@ TransDataCurveHandleFlags *initTransDataCurveHandles(TransData *td, BezTriple *b
void clipUVData(TransInfo *t)
{
/* NOTE(@ideasman42): Often used to clip UV's after proportional editing:
* In this case the radius of the proportional region can end outside the clipping area,
* while not ideal an elegant solution here would likely be computationally expensive
* as it would need to calculate the transform value that would meet the UV bounds.
* While it would be technically correct to handle this properly,
* there isn't a strong use case for it. */
FOREACH_TRANS_DATA_CONTAINER (t, tc) {
TransData *td = tc->data;
for (int a = 0; a < tc->data_len; a++, td++) {
@@ -275,8 +275,7 @@ static void applyResize(TransInfo *t)
ElementResize(t, tc, td, mat);
}
/* XXX(@dg): In proportional edit it can happen that vertices
* in the radius of the brush end outside the clipping area. */
/* Not ideal, see #clipUVData code-comment. */
if (t->flag & T_PROP_EDIT) {
clipUVData(t);
}
@@ -368,10 +368,7 @@ static void applyRotation(TransInfo *t)
applyRotationValue(t, t->values_final[0], axis_final, is_large_rotation);
}
/* In proportional edit it can happen that */
/* vertices in the radius of the brush end */
/* outside the clipping area */
/* XXX HACK - dg */
/* Not ideal, see #clipUVData code-comment. */
if (t->flag & T_PROP_EDIT) {
clipUVData(t);
}
@@ -294,10 +294,7 @@ static void apply_shear(TransInfo *t)
apply_shear_value(t, t->values_final[0]);
}
/* In proportional edit it can happen that */
/* vertices in the radius of the brush end */
/* outside the clipping area */
/* XXX HACK - dg */
/* Not ideal, see #clipUVData code-comment. */
if (t->flag & T_PROP_EDIT) {
clipUVData(t);
}
@@ -642,10 +642,7 @@ static void applyTranslation(TransInfo *t)
if (t->flag & T_CLIP_UV && clip_uv_transform_translation(t, global_dir)) {
applyTranslationValue(t, global_dir);
/* In proportional edit it can happen that */
/* vertices in the radius of the brush end */
/* outside the clipping area */
/* XXX HACK - dg */
/* Not ideal, see #clipUVData code-comment. */
if (t->flag & T_PROP_EDIT) {
clipUVData(t);
}