From d3b5f2641ba37c09d9a238e6032ebba6052ac17f Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Thu, 16 Oct 2025 20:59:52 +0200 Subject: [PATCH] nicer boundaries for grid on disksize --- cell.cpp | 6 ++++++ celldrawer.cpp | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/cell.cpp b/cell.cpp index fbe94009..ac8275d7 100644 --- a/cell.cpp +++ b/cell.cpp @@ -429,6 +429,12 @@ EX bool is_in_disk(cell *c) { return *it == c; } +EX int disk_index(cell *c) { + auto it = lower_bound(all_disk_cells_sorted.begin(), all_disk_cells_sorted.end(), c); + if(it == all_disk_cells_sorted.end() || *it != c) return isize(all_disk_cells_sorted); + return it - all_disk_cells_sorted.begin(); + } + bool sierpinski3(gp::loc g) { int x = g.first; int y = g.second; diff --git a/celldrawer.cpp b/celldrawer.cpp index be224781..a2fb539e 100644 --- a/celldrawer.cpp +++ b/celldrawer.cpp @@ -880,7 +880,9 @@ EX bool pick_for_grid(cell *c, int t) { if(!c1) return false; // removed: if(WDIM == 3 && bt::in() && !sn::in()) return !among(t, 5, 6, 8); if(c == c1 && t <= c->c.spin(t)) return true; - return c < c1 || isWarped(c->move(t)) || fake::split(); + bool order = c < c1; + if(disksize) order = disk_index(c) < disk_index(c1); + return order || isWarped(c->move(t)) || fake::split(); } void celldrawer::draw_grid() {