Permalink
Browse files

Resizable window nearing completion

  • Loading branch information...
mezzoblue committed Oct 31, 2010
1 parent 86df8bd commit a054cb339b89d0f856f9f9df38495f7e10adc81f
View
Binary file not shown.
View
@@ -82,11 +82,14 @@ void setup() {
compass = new uiCompass();
crosshair = new uiCrosshairs();
- chrome = new uiPanel[3];
+ chrome = new uiPanel[6];
// chrome: labels and UI element backing
chrome[0] = new uiPanel("UI-Chrome-Compass");
chrome[1] = new uiPanel("UI-Chrome-Checkboxes");
chrome[2] = new uiPanel("UI-Chrome-Switches");
+ chrome[3] = new uiPanel("UI-Chrome-Elevation");
+ chrome[4] = new uiPanel("UI-Chrome-LatLong");
+ chrome[5] = new uiPanel("UI-Chrome-Zoom");
// arrow buttons
buttons[0] = new uiButton(
View
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
View
Binary file not shown.
View
19 ui.pde
@@ -411,13 +411,12 @@ class uiScale {
void render(color col) {
if (toggle) {
- // find out current width of scene
- kmCount = scene.currentWidth;
-
// how many kilometers wide the base scale is, based on scene width and variable drawingScale value
- kmScale = (kmCount / (kmCount * scene.drawingScale) * cos(scene.averageLat * PI/180));
+ kmScale = (wide / (wide * scene.drawingScale) * cos(scene.averageLat * PI/180));
+ println(kmScale);
// how many pixels between each km marker
+ // (currently the right half of this is causing the scale to clip, but some form of averaging is necessary to keep the scale accurate)
kmInterval = (wide / kmScale) * (1000.00 / wide);
if (!scene.writePDF) {
@@ -640,6 +639,9 @@ void cacheUI() {
for (int i = 0; i < checkboxes.length; i++) {
checkboxes[i].refreshImages();
}
+ for (int i = 0; i < chrome.length; i++) {
+ chrome[i].refreshImages();
+ }
for (int i = 0; i < switches.length; i++) {
switches[i].refreshImages();
}
@@ -651,14 +653,15 @@ void positionUI(int w, int h) {
h -= sceneOffset;
UI.setCoordinates(0, h - 100, w, 100);
- println(UI.wide);
-
- compass.setCoordinates(w / 2, h - 50, 31, 31); // eventually w / 2
- mapScale.setCoordinates(w / 2, h - 106, w, 5); // very wrong when scaled up
+ compass.setCoordinates(w / 2, h - 50, 31, 31);
+ mapScale.setCoordinates(w / 2, h - 106, w, 5);
chrome[0].setCoordinates(w / 2 - 20, h - 70, 41, 41);
chrome[1].setCoordinates(w - 205, h - 70, 147, 39);
chrome[2].setCoordinates(w - 387, h - 43, 82, 28);
+ chrome[3].setCoordinates(227, h - 43, 79, 29);
+ chrome[4].setCoordinates(107, h - 64, 83, 29);
+ chrome[5].setCoordinates(353, h - 43, 59, 29);
checkboxes[0].setCoordinates(w - 134, h - 74, 19, 18);
checkboxes[1].setCoordinates(w - 134, h - 46, 19, 18);

0 comments on commit a054cb3

Please sign in to comment.