diff --git a/archimedean.cpp b/archimedean.cpp index abd60947..1a9ad916 100644 --- a/archimedean.cpp +++ b/archimedean.cpp @@ -577,12 +577,12 @@ void create_adjacent(heptagon *h, int d) { } set visited; -queue> drawqueue; +queue> drawqueue; void enqueue(heptagon *h, const transmatrix& T) { if(visited.count(h)) { return; } visited.insert(h); - drawqueue.emplace(h, T); + drawqueue.emplace(h, T, band_shift); } pair& archimedean_tiling::get_triangle(heptagon *h, int cid) { @@ -620,8 +620,9 @@ void draw() { while(!drawqueue.empty()) { auto p = drawqueue.front(); drawqueue.pop(); - heptagon *h = p.first; - transmatrix V = p.second; + heptagon *h = get<0>(p); + transmatrix V = get<1>(p); + dynamicval b(band_shift, get<2>(p)); int id = id_of(h); int S = isize(current.triangles[id]); @@ -636,7 +637,9 @@ void draw() { if(DUAL && (i&1)) continue; h->cmove(i); if(PURE && id >= 2*current.N && h->move(i) && id_of(h->move(i)) >= 2*current.N) continue; - enqueue(h->move(i), V * adjcell_matrix(h, i)); + transmatrix V1 = V * adjcell_matrix(h, i); + bandfixer bf(V1); + enqueue(h->move(i), V1); } idx++; } diff --git a/binary-tiling.cpp b/binary-tiling.cpp index dc7b5ac7..cf025473 100644 --- a/binary-tiling.cpp +++ b/binary-tiling.cpp @@ -154,29 +154,32 @@ namespace binary { void draw_rec(cell *c, int dirs, const transmatrix& V, int reclev) { + transmatrix V1 = V; + bandfixer bf(V1); + if(vid.use_smart_range == 0 && !dodrawcell(c)) return; - if(vid.use_smart_range && reclev >= 2 && !in_smart_range(V)) return; + if(vid.use_smart_range && reclev >= 2 && !in_smart_range(V1)) return; if(vid.use_smart_range == 2) setdist(c, 7, c); - drawcell(c, V, 0, false); + drawcell(c, V1, 0, false); // 1: up if(dirs & 1) - draw_rec(createMov(c, bd_up), 7, V * xpush(-log(2)), reclev+1); + draw_rec(createMov(c, bd_up), 7, V1 * xpush(-log(2)), reclev+1); // right if(dirs & 2) - draw_rec(createMov(c, bd_right), 2, V * parabolic(1), reclev+1); + draw_rec(createMov(c, bd_right), 2, V1 * parabolic(1), reclev+1); // left if(dirs & 4) - draw_rec(createMov(c, bd_left), 4, V * parabolic(-1), reclev+1); + draw_rec(createMov(c, bd_left), 4, V1 * parabolic(-1), reclev+1); // down if((dirs & 8) && c->type == 6) - draw_rec(createMov(c, bd_down), dirs & 62, V * xpush(log(2)), reclev+1); + draw_rec(createMov(c, bd_down), dirs & 62, V1 * xpush(log(2)), reclev+1); // down_left if((dirs & 16) && c->type == 7) - draw_rec(createMov(c, bd_down_left), dirs & 28, V * parabolic(-1) * xpush(log(2)), reclev+1); + draw_rec(createMov(c, bd_down_left), dirs & 28, V1 * parabolic(-1) * xpush(log(2)), reclev+1); // down_right if((dirs & 32) && c->type == 7) - draw_rec(createMov(c, bd_down_right), dirs & 42, V * parabolic(1) * xpush(log(2)), reclev+1); + draw_rec(createMov(c, bd_down_right), dirs & 42, V1 * parabolic(1) * xpush(log(2)), reclev+1); } void draw() {