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:
authorJacques Lucke <jacques@blender.org>2020-09-09 19:41:07 +0300
committerJacques Lucke <jacques@blender.org>2020-09-09 19:41:07 +0300
commit63916f5941b443dfc8566682bb75374e5abd553f (patch)
treefb0704701f1d4d9acbddf4a6fbc62c819d8d4c36 /source/blender/editors/gpencil/gpencil_merge.c
parent0cff2c944f9c2cd3ac873fe826c4399fc2f32159 (diff)
Cleanup: reduce variable scope
Diffstat (limited to 'source/blender/editors/gpencil/gpencil_merge.c')
-rw-r--r--source/blender/editors/gpencil/gpencil_merge.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/source/blender/editors/gpencil/gpencil_merge.c b/source/blender/editors/gpencil/gpencil_merge.c
index 4aae0b97e05..ca93e8de844 100644
--- a/source/blender/editors/gpencil/gpencil_merge.c
+++ b/source/blender/editors/gpencil/gpencil_merge.c
@@ -200,7 +200,6 @@ static void gpencil_calc_points_factor(bContext *C,
tGPencilPointCache *src_array)
{
bGPDspoint *pt;
- int i;
int idx = 0;
/* create selected point array an fill it */
@@ -214,6 +213,7 @@ static void gpencil_calc_points_factor(bContext *C,
}
LISTBASE_FOREACH (bGPDstroke *, gps, &gpf->strokes) {
if (gps->flag & GP_STROKE_SELECT) {
+ int i;
for (i = 0, pt = gps->points; i < gps->totpoints; i++, pt++) {
if (clear_stroke) {
pt->flag |= GP_SPOINT_TAG;
@@ -252,7 +252,7 @@ static void gpencil_calc_points_factor(bContext *C,
/* calc center */
float center[2] = {0.0f, 0.0f};
- for (i = 0; i < totpoints; i++) {
+ for (int i = 0; i < totpoints; i++) {
center[0] += points2d[i][0];
center[1] += points2d[i][1];
}
@@ -261,7 +261,7 @@ static void gpencil_calc_points_factor(bContext *C,
/* calc angle and distance to center for each point */
const float axis[2] = {1.0f, 0.0f};
float v1[3];
- for (i = 0; i < totpoints; i++) {
+ for (int i = 0; i < totpoints; i++) {
float ln = len_v2v2(center, points2d[i]);
sub_v2_v2v2(v1, points2d[i], center);
float angle = angle_signed_v2v2(axis, v1);
@@ -337,10 +337,9 @@ static void gpencil_get_extremes(
tGPencilPointCache *src_array, int totpoints, bGPDstroke *gps_filter, float *start, float *end)
{
tGPencilPointCache *array_pt = NULL;
- int i;
/* find first point */
- for (i = 0; i < totpoints; i++) {
+ for (int i = 0; i < totpoints; i++) {
array_pt = &src_array[i];
if (gps_filter == array_pt->gps) {
copy_v3_v3(start, &array_pt->x);
@@ -348,7 +347,7 @@ static void gpencil_get_extremes(
}
}
/* find last point */
- for (i = totpoints - 1; i >= 0; i--) {
+ for (int i = totpoints - 1; i >= 0; i--) {
array_pt = &src_array[i];
if (gps_filter == array_pt->gps) {
copy_v3_v3(end, &array_pt->x);