From 68708346de286fe3420fac10e52daae6f83c9cf6 Mon Sep 17 00:00:00 2001 From: Martin Poirier Date: Wed, 21 May 2008 10:02:07 +0000 Subject: [PATCH] [#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) --- source/blender/src/transform.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/source/blender/src/transform.c b/source/blender/src/transform.c index b462422a408..10035c61651 100644 --- a/source/blender/src/transform.c +++ b/source/blender/src/transform.c @@ -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 */