for (int x = 0; x < Ns; ++x) {
for (int y = 0; y < Ns; ++y) {
Rectangle* r = new Rectangle (canvas.root ());
r->set (Rect (x * max_x / Ns, y * max_y / Ns, (x + 1) * max_x / Ns, (y + 1) * max_y / Ns));
}
}
for (int x = 0; x < Ns; ++x) {
for (int y = 0; y < Ns; ++y) {
Rectangle* r = new Rectangle (canvas.root ());
r->set (Rect (x * max_x / Ns, y * max_y / Ns, (x + 1) * max_x / Ns, (y + 1) * max_y / Ns));
}
}