From b9c76d8162a577f7c12daf8039024e67642b6644 Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Tue, 26 Apr 2022 16:17:01 +0200 Subject: [PATCH] options to disable apeirogon_consistent_coloring and apeirogon_hide_grid_edges --- arbitrile.cpp | 3 +++ celldrawer.cpp | 4 +++- config.cpp | 5 +++++ pattern2.cpp | 2 +- 4 files changed, 12 insertions(+), 2 deletions(-) diff --git a/arbitrile.cpp b/arbitrile.cpp index 7ccf9cf2..813ee95d 100644 --- a/arbitrile.cpp +++ b/arbitrile.cpp @@ -1010,6 +1010,9 @@ EX bool is_apeirogonal(cell *c) { return current_or_slided().shapes[id_of(c->master)].apeirogonal; } +EX bool apeirogon_consistent_coloring = true; +EX bool apeirogon_hide_grid_edges = true; + EX transmatrix get_adj(arbi_tiling& c, int t, int dl, int t1, int xdl) { auto& sh = c.shapes[t]; diff --git a/celldrawer.cpp b/celldrawer.cpp index 085b2a18..7f6dce43 100644 --- a/celldrawer.cpp +++ b/celldrawer.cpp @@ -924,7 +924,9 @@ void celldrawer::draw_grid() { gridline(V, get_warp_corner(c, t%c->type), get_warp_corner(c, (t+1)%c->type), gridcolor(c, c->move(t)), prec); } else { - for(int t=0; ttype; t++) + int maxt = c->type; + if(arb::apeirogon_hide_grid_edges && arb::is_apeirogonal(c)) maxt -= 2; + for(int t=0; tmove(t) && (c->move(t) < c || isWarped(c->move(t)) || fake::split())) gridline(V, get_corner_position(c, t%c->type), get_corner_position(c, (t+1)%c->type), gridcolor(c, c->move(t)), prec); } diff --git a/config.cpp b/config.cpp index aef43820..943beffb 100644 --- a/config.cpp +++ b/config.cpp @@ -646,6 +646,11 @@ EX void initConfig() { param_b(resizable, "resizable", true) -> editable("resizable window", 'r'); + param_b(arb::apeirogon_consistent_coloring, "apeirogon_consistent_coloring", true) + -> editable("apeirogon_consistent_coloring", 'c'); + param_b(arb::apeirogon_hide_grid_edges, "apeirogon_hide_grid_edges", true) + -> editable("apeirogon_hide_grid_edges", 'h'); + param_b(display_yasc_codes, "yasc", false) -> editable("YASC codes", 'Y') -> set_reaction([] { diff --git a/pattern2.cpp b/pattern2.cpp index 23a8c42d..39314fab 100644 --- a/pattern2.cpp +++ b/pattern2.cpp @@ -1767,7 +1767,7 @@ EX namespace patterns { int i = callhandlers(-1, hooks_generate_canvas, c); if(i != -1) return i; - if(arb::is_apeirogonal(c)) { + if(arb::apeirogon_consistent_coloring && arb::is_apeirogonal(c)) { for(cell *c1: {c->move(c->type-1), c->move(c->type-2), c->cmove(c->type-1)->move(c->type-1), c->cmove(c->type-2)->move(c->type-2)}) if(c1 && c1->mpdist <= BARLEV) return c1->landparam; }