[#11748] Bevel tool not snapping when holding down ctrl and adjusting value

Added proper gear support and fixed some misc errors in the setup of this transformation (negative values hav no effect, so use absolute value and other small things like that)
This commit is contained in:
Martin Poirier
2008-05-21 10:02:07 +00:00
parent 38ffd41bf0
commit 68708346de

View File

@@ -3348,8 +3348,17 @@ void initBevel(TransInfo *t)
{
t->mode = TFM_BEVEL;
t->flag |= T_NO_CONSTRAINT;
t->num.flag |= NUM_NO_NEGATIVE;
t->transform = Bevel;
t->handleEvent = handleEventBevel;
t->idx_max = 0;
t->num.idx_max = 0;
t->snap[0] = 0.0f;
t->snap[1] = 0.1f;
t->snap[2] = t->snap[1] * 0.1f;
/* DON'T KNOW WHY THIS IS NEEDED */
if (G.editBMesh->imval[0] == 0 && G.editBMesh->imval[1] == 0) {
/* save the initial mouse co */
G.editBMesh->imval[0] = t->imval[0];
@@ -3405,6 +3414,10 @@ int Bevel(TransInfo *t, short mval[2])
mode = (G.editBMesh->options & BME_BEVEL_VERT) ? "verts only" : "normal";
distance = InputHorizontalAbsolute(t, mval)/4; /* 4 just seemed a nice value to me, nothing special */
distance = fabs(distance);
snapGrid(t, &distance);
applyNumInput(&t->num, &distance);
@@ -3414,7 +3427,7 @@ int Bevel(TransInfo *t, short mval[2])
outputNumInput(&(t->num), c);
sprintf(str, "Bevel: %s", c);
sprintf(str, "Bevel - Dist: %s, Mode: %s (MMB to toggle))", c, mode);
}
else {
/* default header print */