+
+ UpdateZoom();
+}
+
+
+void ApplicationWindow::UpdateZoom(void)
+{
+ // And now, a bunch of heuristics to select the right grid size--autogrid!
+ // :-P
+ if (Global::zoom < 0.25)
+ Global::gridSpacing = 48.0;
+ else if (Global::zoom >= 0.25 && Global::zoom < 0.50)
+ Global::gridSpacing = 36.0;
+ else if (Global::zoom >= 0.50 && Global::zoom < 1.00)
+ Global::gridSpacing = 24.0;
+ else if (Global::zoom >= 1.00 && Global::zoom < 2.00)
+ Global::gridSpacing = 12.0;
+ else if (Global::zoom >= 2.00 && Global::zoom < 4.00)
+ Global::gridSpacing = 6.0;
+ else if (Global::zoom >= 4.00 && Global::zoom < 8.00)
+ Global::gridSpacing = 3.0;
+ else if (Global::zoom >= 8.00 && Global::zoom < 16.00)
+ Global::gridSpacing = 1.0;
+ else if (Global::zoom >= 16.00 && Global::zoom < 32.00)
+ Global::gridSpacing = 0.5;
+ else if (Global::zoom >= 32.00 && Global::zoom < 64.00)
+ Global::gridSpacing = 0.25;
+ else if (Global::zoom >= 64.00 && Global::zoom < 128.00)
+ Global::gridSpacing = 0.125;
+ else if (Global::zoom >= 128.00 && Global::zoom < 256.00)
+ Global::gridSpacing = 0.0625;
+ else if (Global::zoom >= 256.00 && Global::zoom < 512.00)
+ Global::gridSpacing = 0.03125;
+ else
+ Global::gridSpacing = 0.015625;
+
+ drawing->SetGridSize((double)(Global::gridSpacing * Global::zoom));