=== UV Transform ===

[ #5880 ] Crash on editing UVs

Caused by late check for 3d view in transform snap.
This commit is contained in:
2007-01-30 15:48:09 +00:00
parent a42c8533aa
commit ff75e7d302

View File

@@ -151,11 +151,12 @@ void resetSnapping(TransInfo *t)
void initSnapping(TransInfo *t)
{
resetSnapping(t);
if (t->spacetype == SPACE_VIEW3D) { // Only 3D view (not UV)
setSnappingCallback(t);
if (t->tsnap.applySnap != NULL && // A snapping function actually exist
(G.obedit != NULL && G.obedit->type==OB_MESH) && // Temporary limited to edit mode meshes
(t->spacetype == SPACE_VIEW3D) && // Only 3D view (not UV)
(G.vd->flag2 & V3D_TRANSFORM_SNAP) && // Only if the snap flag is on
(t->flag & T_PROP_EDIT) == 0) // No PET, obviously
{
@@ -164,6 +165,13 @@ void initSnapping(TransInfo *t)
}
else
{
/* Grid if snap is not possible */
t->tsnap.modePoint = SNAP_GRID;
}
}
else
{
/* Always grid outside of 3D view */
t->tsnap.modePoint = SNAP_GRID;
}
}
@@ -172,7 +180,6 @@ void setSnappingCallback(TransInfo *t)
{
t->tsnap.calcSnap = CalcSnapGeometry;
switch(G.vd->snap_target)
{
case V3D_SNAP_TARGET_CLOSEST:
@@ -205,9 +212,6 @@ void setSnappingCallback(TransInfo *t)
t->tsnap.targetSnap = TargetSnapMedian;
}
break;
case TFM_RESIZE:
t->tsnap.applySnap = NULL;
break;
default:
t->tsnap.applySnap = NULL;
break;