options to disable apeirogon_consistent_coloring and apeirogon_hide_grid_edges

This commit is contained in:
Zeno Rogue 2022-04-26 16:17:01 +02:00
parent 61c3e41e8a
commit b9c76d8162
4 changed files with 12 additions and 2 deletions

View File

@ -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];

View File

@ -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; t<c->type; t++)
int maxt = c->type;
if(arb::apeirogon_hide_grid_edges && arb::is_apeirogonal(c)) maxt -= 2;
for(int t=0; t<maxt; t++)
if(c->move(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);
}

View File

@ -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([] {

View File

@ -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;
}