From d9285c28dc85cfdbdaa789bb32a4ca23ceb0cc15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Ne=C4=8Dada?= Date: Thu, 23 Aug 2018 14:33:03 +0300 Subject: [PATCH] Triang. lat. gen. fixes Former-commit-id: f1bd8375c4a1e10aa922dfa922a18eaa22fe07ce --- qpms/lattices2d.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/qpms/lattices2d.c b/qpms/lattices2d.c index f37b11a..d5b9f20 100644 --- a/qpms/lattices2d.c +++ b/qpms/lattices2d.c @@ -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;