diff --git a/examples/Parameters/ExampleUIParameters.cpp b/examples/Parameters/ExampleUIParameters.cpp index 1c40c79d..c427ab44 100644 --- a/examples/Parameters/ExampleUIParameters.cpp +++ b/examples/Parameters/ExampleUIParameters.cpp @@ -39,7 +39,7 @@ public: std::memset(fParamGrid, 0, sizeof(bool)*9); // TODO explain why this is here - setGeometryConstraints(128, 128, true); + setGeometryConstraints(128, 128, true, false); } protected: @@ -104,16 +104,17 @@ protected: { const uint width = getWidth(); const uint height = getHeight(); + const uint minwh = std::min(width, height); Rectangle r; - r.setWidth(width/3 - 6); - r.setHeight(height/3 - 6); + r.setWidth(minwh/3 - 6); + r.setHeight(minwh/3 - 6); // draw left, center and right columns for (int i=0; i<3; ++i) { - r.setX(3 + i*width/3); + r.setX(3 + i*minwh/3); // top r.setY(3); @@ -126,7 +127,7 @@ protected: r.draw(); // middle - r.setY(3 + height/3); + r.setY(3 + minwh/3); if (fParamGrid[3+i]) glColor3f(0.8f, 0.5f, 0.3f); @@ -136,7 +137,7 @@ protected: r.draw(); // bottom - r.setY(3 + height*2/3); + r.setY(3 + minwh*2/3); if (fParamGrid[6+i]) glColor3f(0.8f, 0.5f, 0.3f); @@ -159,16 +160,17 @@ protected: const uint width = getWidth(); const uint height = getHeight(); + const uint minwh = std::min(width, height); Rectangle r; - r.setWidth(width/3 - 6); - r.setHeight(height/3 - 6); + r.setWidth(minwh/3 - 6); + r.setHeight(minwh/3 - 6); // handle left, center and right columns for (int i=0; i<3; ++i) { - r.setX(3 + i*width/3); + r.setX(3 + i*minwh/3); // top r.setY(3); @@ -190,7 +192,7 @@ protected: } // middle - r.setY(3 + height/3); + r.setY(3 + minwh/3); if (r.contains(ev.pos)) { @@ -203,7 +205,7 @@ protected: } // bottom - r.setY(3 + height*2/3); + r.setY(3 + minwh*2/3); if (r.contains(ev.pos)) {