Fix T53145: bevel tool fails when used a second time.

Pixel size was not initial early enough. For first time this was not a problem
because the bevel amount starts at 0 then, and after the mouse moves the pixel
size is initialized. For the second time the bevel amount starts at a non-zero
value, and it failed then.
This commit is contained in:
Brecht Van Lommel 2017-11-23 20:14:31 +01:00 committed by Bastien Montagne
parent bb89759624
commit 36f324fc55
1 changed files with 2 additions and 1 deletions

View File

@ -334,11 +334,12 @@ static int edbm_bevel_invoke(bContext *C, wmOperator *op, const wmEvent *event)
* ideally this will never happen and should be checked for above */
opdata->mcenter[0] = opdata->mcenter[1] = 0;
}
edbm_bevel_calc_initial_length(op, event, false);
/* for OFFSET_VALUE only, the scale is the size of a pixel under the mouse in 3d space */
opdata->scale[OFFSET_VALUE] = rv3d ? ED_view3d_pixel_size(rv3d, center_3d) : 1.0f;
edbm_bevel_calc_initial_length(op, event, false);
edbm_bevel_update_header(C, op);
if (!edbm_bevel_calc(op)) {