diff options
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/curve/editcurve.c | 3 | ||||
-rw-r--r-- | source/blender/editors/gpencil/drawgpencil.c | 6 | ||||
-rw-r--r-- | source/blender/editors/gpencil/gpencil_brush.c | 6 | ||||
-rw-r--r-- | source/blender/editors/gpencil/gpencil_paint.c | 6 | ||||
-rw-r--r-- | source/blender/editors/gpencil/gpencil_utils.c | 8 | ||||
-rw-r--r-- | source/blender/editors/space_view3d/view3d_edit.c | 36 |
6 files changed, 33 insertions, 32 deletions
diff --git a/source/blender/editors/curve/editcurve.c b/source/blender/editors/curve/editcurve.c index 9e3344914bb..1dd32d6b1a2 100644 --- a/source/blender/editors/curve/editcurve.c +++ b/source/blender/editors/curve/editcurve.c @@ -5852,6 +5852,7 @@ static int curve_dissolve_exec(bContext *C, wmOperator *UNUSED(op)) BLI_assert(points_stride + dims == points + (points_len * dims)); float tan_l[3], tan_r[3], error_sq_dummy; + unsigned int error_index_dummy; sub_v3_v3v3(tan_l, bezt_prev->vec[1], bezt_prev->vec[2]); normalize_v3(tan_l); @@ -5862,7 +5863,7 @@ static int curve_dissolve_exec(bContext *C, wmOperator *UNUSED(op)) points, points_len, NULL, dims, FLT_EPSILON, tan_l, tan_r, bezt_prev->vec[2], bezt_next->vec[0], - &error_sq_dummy); + &error_sq_dummy, &error_index_dummy); if (!ELEM(bezt_prev->h2, HD_FREE, HD_ALIGN)) { bezt_prev->h2 = (bezt_prev->h2 == HD_VECT) ? HD_FREE : HD_ALIGN; diff --git a/source/blender/editors/gpencil/drawgpencil.c b/source/blender/editors/gpencil/drawgpencil.c index d36122fa133..20929e4b908 100644 --- a/source/blender/editors/gpencil/drawgpencil.c +++ b/source/blender/editors/gpencil/drawgpencil.c @@ -137,9 +137,9 @@ static void gp_draw_stroke_buffer_fill(const tGPspoint *points, int totpoints, f float(*points2d)[2] = MEM_mallocN(sizeof(*points2d) * totpoints, "GP Stroke buffer temp 2d points"); /* Convert points to array and triangulate - * Here a cache is not used because while drawing the information changes all the time, so the cache - * would be recalculated constantly, so it is better to do direct calculation for each function call - */ + * Here a cache is not used because while drawing the information changes all the time, so the cache + * would be recalculated constantly, so it is better to do direct calculation for each function call + */ for (int i = 0; i < totpoints; i++) { const tGPspoint *pt = &points[i]; points2d[i][0] = pt->x; diff --git a/source/blender/editors/gpencil/gpencil_brush.c b/source/blender/editors/gpencil/gpencil_brush.c index c834b503cd1..c2807f72fbb 100644 --- a/source/blender/editors/gpencil/gpencil_brush.c +++ b/source/blender/editors/gpencil/gpencil_brush.c @@ -297,9 +297,9 @@ static bool gp_brush_strength_apply( float inf; /* Compute strength of effect - * - We divide the strength by 10, so that users can set "sane" values. - * Otherwise, good default values are in the range of 0.093 - */ + * - We divide the strength by 10, so that users can set "sane" values. + * Otherwise, good default values are in the range of 0.093 + */ inf = gp_brush_influence_calc(gso, radius, co) / 10.0f; /* apply */ diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c index b86dcc33c73..1778d243849 100644 --- a/source/blender/editors/gpencil/gpencil_paint.c +++ b/source/blender/editors/gpencil/gpencil_paint.c @@ -1009,9 +1009,9 @@ static void gp_stroke_newfrombuffer(tGPsdata *p) BLI_strncpy(gps->colorname, palcolor->info, sizeof(gps->colorname)); /* add stroke to frame, usually on tail of the listbase, but if on back is enabled the stroke is added on listbase head - * because the drawing order is inverse and the head stroke is the first to draw. This is very useful for artist - * when drawing the background - */ + * because the drawing order is inverse and the head stroke is the first to draw. This is very useful for artist + * when drawing the background + */ if ((ts->gpencil_flags & GP_TOOL_FLAG_PAINT_ONBACK) && (p->paintmode != GP_PAINTMODE_DRAW_POLY)) { BLI_addhead(&p->gpf->strokes, gps); } diff --git a/source/blender/editors/gpencil/gpencil_utils.c b/source/blender/editors/gpencil/gpencil_utils.c index 693defb8b1b..9ed5cf57eec 100644 --- a/source/blender/editors/gpencil/gpencil_utils.c +++ b/source/blender/editors/gpencil/gpencil_utils.c @@ -831,8 +831,8 @@ bool gp_smooth_stroke_strength(bGPDstroke *gps, int i, float inf) ptc = &gps->points[after]; /* the optimal value is the corresponding to the interpolation of the strength - * at the distance of point b - */ + * at the distance of point b + */ const float fac = line_point_factor_v3(&ptb->x, &pta->x, &ptc->x); const float optimal = (1.0f - fac) * pta->strength + fac * ptc->strength; @@ -869,8 +869,8 @@ bool gp_smooth_stroke_thickness(bGPDstroke *gps, int i, float inf) ptc = &gps->points[after]; /* the optimal value is the corresponding to the interpolation of the pressure - * at the distance of point b - */ + * at the distance of point b + */ float fac = line_point_factor_v3(&ptb->x, &pta->x, &ptc->x); float optimal = (1.0f - fac) * pta->pressure + fac * ptc->pressure; diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c index 42e8759c6dc..63024b489e1 100644 --- a/source/blender/editors/space_view3d/view3d_edit.c +++ b/source/blender/editors/space_view3d/view3d_edit.c @@ -698,22 +698,21 @@ static bool view3d_orbit_calc_center(bContext *C, float r_dyn_ofs[3]) } enum eViewOpsOrbit { - VIEWOPS_ORBIT_DEFAULT = 0, - VIEWOPS_ORBIT_SELECT = 1, - VIEWOPS_ORBIT_DEPTH = 2, + VIEWOPS_ORBIT_SELECT = (1 << 0), + VIEWOPS_ORBIT_DEPTH = (1 << 1), }; static enum eViewOpsOrbit viewops_orbit_mode_ex(bool use_select, bool use_depth) { + enum eViewOpsOrbit flag = 0; if (use_select) { - return VIEWOPS_ORBIT_SELECT; + flag |= VIEWOPS_ORBIT_SELECT; } - else if (use_depth) { - return VIEWOPS_ORBIT_DEPTH; - } - else { - return VIEWOPS_ORBIT_DEFAULT; + if (use_depth) { + flag |= VIEWOPS_ORBIT_DEPTH; } + + return flag; } static enum eViewOpsOrbit viewops_orbit_mode(void) @@ -734,7 +733,7 @@ static void viewops_data_create_ex( RegionView3D *rv3d = vod->rv3d; /* we need the depth info before changing any viewport options */ - if (orbit_mode == VIEWOPS_ORBIT_DEPTH) { + if (orbit_mode & VIEWOPS_ORBIT_DEPTH) { struct Depsgraph *graph = CTX_data_depsgraph(C); float fallback_depth_pt[3]; @@ -774,15 +773,16 @@ static void viewops_data_create_ex( vod->origkey = event->type; /* the key that triggered the operator. */ copy_v3_v3(vod->ofs, rv3d->ofs); - if (orbit_mode == VIEWOPS_ORBIT_SELECT) { - - vod->use_dyn_ofs = true; - - view3d_orbit_calc_center(C, vod->dyn_ofs); - - negate_v3(vod->dyn_ofs); + if (orbit_mode & VIEWOPS_ORBIT_SELECT) { + float ofs[3]; + if (view3d_orbit_calc_center(C, ofs) || (vod->use_dyn_ofs == false)) { + vod->use_dyn_ofs = true; + negate_v3_v3(vod->dyn_ofs, ofs); + orbit_mode &= ~VIEWOPS_ORBIT_DEPTH; + } } - else if (orbit_mode == VIEWOPS_ORBIT_DEPTH) { + + if (orbit_mode & VIEWOPS_ORBIT_DEPTH) { if (vod->use_dyn_ofs) { if (rv3d->is_persp) { float my_origin[3]; /* original G.vd->ofs */ |