Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Poirier <theeth@yahoo.com>2004-04-11 04:23:06 +0400
committerMartin Poirier <theeth@yahoo.com>2004-04-11 04:23:06 +0400
commit1039d15f5787c450af13146ca85e5ed1696b9cda (patch)
tree2f602446d2628db2743745a87266f450a9d185cb
parentb9659a072a9596749ac84ff326a04c48972f53d5 (diff)
Fix for bug #1145 bevel numbutton not changing when clicking on the sides
http://projects.blender.org/tracker/index.php?func=detail&aid=1145&group_id=9&atid=125 I changed the fbutton function to give the possibility to control the a1 and a2 parameters of the button. This commit also fixes two things in the bevel function: - The numbut didn't do anything because it wasn't recalculating the proper variable - The display wasn't recalculated when pressing Ctrl or Shift (it's now done by recalculating after every keyboard event. I've done it this way since the event loops seems to skip CTRL and SHIFT events)
-rw-r--r--source/blender/include/BIF_toolbox.h2
-rw-r--r--source/blender/src/editmesh.c15
-rw-r--r--source/blender/src/toolbox.c4
3 files changed, 13 insertions, 8 deletions
diff --git a/source/blender/include/BIF_toolbox.h b/source/blender/include/BIF_toolbox.h
index e5db9d8ac0f..1350592a0ee 100644
--- a/source/blender/include/BIF_toolbox.h
+++ b/source/blender/include/BIF_toolbox.h
@@ -113,7 +113,7 @@ int saveover (char *filename);
int okee (char *fmt, ...);
short button (short *var, short min, short max, char *str);
-short fbutton (float *var, float min, float max, char *str);
+short fbutton (float *var, float min, float max, float a1, float a2, char *str);
short sbutton (char *var, float min, float max, char *str); /* __NLA */
int movetolayer_buts (unsigned int *lay);
void draw_numbuts_tip (char *str, int x1, int y1, int x2, int y2);
diff --git a/source/blender/src/editmesh.c b/source/blender/src/editmesh.c
index f3dfe31ff1d..b3f5dff8898 100644
--- a/source/blender/src/editmesh.c
+++ b/source/blender/src/editmesh.c
@@ -3273,7 +3273,6 @@ void loopoperations(char mode)
addqueue(curarea->win, REDRAW, 1);
}
-
void edge_select(void)
{
EditMesh *em = G.editMesh;
@@ -6306,7 +6305,6 @@ void vertexsmooth(void)
makeDispList(G.obedit);
}
-
void vertexnoise(void)
{
EditMesh *em = G.editMesh;
@@ -9134,7 +9132,7 @@ void bevel_mesh_recurs(float bsize, short recurs, int allfaces)
void bevel_menu()
{
- char Finished = 0, Canceled = 0, str[100];
+ char Finished = 0, Canceled = 0, str[100], Recalc = 0;
short mval[2], oval[2], curval[2], event = 0, recurs = 1, nr;
float vec[3], d, drawd, centre[3], fac = 1;
@@ -9158,8 +9156,9 @@ void bevel_menu()
while (Finished == 0)
{
getmouseco_areawin(mval);
- if (mval[0] != curval[0] || mval[1] != curval[1])
+ if (mval[0] != curval[0] || mval[1] != curval[1] || (Recalc == 1))
{
+ Recalc = 0;
curval[0] = mval[0];
curval[1] = mval[1];
@@ -9227,8 +9226,14 @@ void bevel_menu()
Finished = 1;
}
else if (val && event==SPACEKEY) {
- if (fbutton(&d, 0.000, 10.000, "Width:")!=0)
+ if (fbutton(&d, 0.000, 10.000, 10, 0, "Width:")!=0) {
+ drawd = d * fac;
Finished = 1;
+ }
+ }
+ else if (val) {
+ /* On any other keyboard event, recalc */
+ Recalc = 1;
}
}
diff --git a/source/blender/src/toolbox.c b/source/blender/src/toolbox.c
index 6981469d4d2..1bccd979d3d 100644
--- a/source/blender/src/toolbox.c
+++ b/source/blender/src/toolbox.c
@@ -1169,7 +1169,7 @@ short sbutton(char *var, float min, float max, char *str)
return 0;
}
-short fbutton(float *var, float min, float max, char *str)
+short fbutton(float *var, float min, float max, float a1, float a2, char *str)
{
uiBlock *block;
ListBase listb={0, 0};
@@ -1191,7 +1191,7 @@ short fbutton(float *var, float min, float max, char *str)
x1=mval[0]-150;
y1=mval[1]-20;
- uiDefButF(block, NUM, 0, str,(short)(x1+5),(short)(y1+10),125,20, var, min, max, 0, 0, "");
+ uiDefButF(block, NUM, 0, str,(short)(x1+5),(short)(y1+10),125,20, var, min, max, a1, a2, "");
uiDefBut(block, BUT, 1, "OK",(short)(x1+136),(short)(y1+10), 35, 20, NULL, 0, 0, 0, 0, "");
uiBoundsBlock(block, 2);