bugfix [#24509] UV/Image Editor: selected elements move not as specified
This commit is contained in:
@@ -225,9 +225,18 @@ void ED_space_image_uv_aspect(SpaceImage *sima, float *aspx, float *aspy)
|
||||
|
||||
ED_space_image_aspect(sima, aspx, aspy);
|
||||
ED_space_image_size(sima, &w, &h);
|
||||
|
||||
*aspx *= (float)w;
|
||||
*aspy *= (float)h;
|
||||
|
||||
*aspx *= (float)w/256.0f;
|
||||
*aspy *= (float)h/256.0f;
|
||||
if(*aspx < *aspy) {
|
||||
*aspy= *aspy / *aspx;
|
||||
*aspx= 1.0f;
|
||||
}
|
||||
else {
|
||||
*aspx= *aspx / *aspy;
|
||||
*aspy= 1.0f;
|
||||
}
|
||||
}
|
||||
|
||||
void ED_image_uv_aspect(Image *ima, float *aspx, float *aspy)
|
||||
|
||||
@@ -3426,6 +3426,9 @@ int Translation(TransInfo *t, short UNUSED(mval[2]))
|
||||
if (t->con.mode & CON_APPLY) {
|
||||
float pvec[3] = {0.0f, 0.0f, 0.0f};
|
||||
float tvec[3];
|
||||
if (hasNumInput(&t->num)) {
|
||||
removeAspectRatio(t, t->values);
|
||||
}
|
||||
applySnapping(t, t->values);
|
||||
t->con.applyVec(t, NULL, t->values, tvec, pvec);
|
||||
VECCOPY(t->values, tvec);
|
||||
@@ -3435,11 +3438,9 @@ int Translation(TransInfo *t, short UNUSED(mval[2]))
|
||||
applyNDofInput(&t->ndof, t->values);
|
||||
snapGrid(t, t->values);
|
||||
applyNumInput(&t->num, t->values);
|
||||
if (hasNumInput(&t->num))
|
||||
{
|
||||
if (hasNumInput(&t->num)) {
|
||||
removeAspectRatio(t, t->values);
|
||||
}
|
||||
|
||||
applySnapping(t, t->values);
|
||||
headerTranslation(t, t->values, str);
|
||||
}
|
||||
|
||||
@@ -154,6 +154,7 @@ static void postConstraintChecks(TransInfo *t, float vec[3], float pvec[3]) {
|
||||
|
||||
if (hasNumInput(&t->num)) {
|
||||
applyNumInput(&t->num, vec);
|
||||
removeAspectRatio(t, vec);
|
||||
constraintNumInput(t, vec);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user