Triang. lat. gen. fixes

Former-commit-id: f1bd8375c4a1e10aa922dfa922a18eaa22fe07ce
This commit is contained in:
Marek Nečada 2018-08-23 14:33:03 +03:00
parent e6217bd363
commit d9285c28dc
1 changed files with 3 additions and 0 deletions

View File

@ -36,8 +36,10 @@ points2d_rordered_t *points2d_rordered_scale(const points2d_rordered_t *orig, co
p->r_offsets[i] = orig->r_offsets[i];
}
p->r_offsets[p->nrs] = orig->r_offsets[p->nrs];
p->base = malloc(sizeof(point2d) * p->r_offsets[p->nrs]);
for(size_t i = 0; i < p->r_offsets[p->nrs]; ++i)
p->base[i] = point2d_fromxy(orig->base[i].x * f, orig->base[i].y * f);
return p;
}
@ -387,6 +389,7 @@ int triangular_lattice_gen_extend_to_steps(triangular_lattice_gen_t * g, int max
++(g->ps.r_offsets[g->ps.nrs+1]);
}
}
++(g->ps.nrs);
}
g->priv->maxs = maxsteps;
return 0;