diff --git a/src/graphicswin.cpp b/src/graphicswin.cpp index 17e04dce..cac542ae 100644 --- a/src/graphicswin.cpp +++ b/src/graphicswin.cpp @@ -430,7 +430,7 @@ void GraphicsWindow::Init() { using namespace std::placeholders; // Do this first, so that if it causes an onRender event we don't try to paint without // a canvas. - window->SetMinContentSize(720, 670); + window->SetMinContentSize(720, /*ToolbarDrawOrHitTest 636*/ 32 * 18 + 3 * 16 + 8 + 4); window->onClose = std::bind(&SolveSpaceUI::MenuFile, Command::EXIT); window->onRender = std::bind(&GraphicsWindow::Paint, this); window->onKeyboardEvent = std::bind(&GraphicsWindow::KeyboardEvent, this, _1); diff --git a/src/toolbar.cpp b/src/toolbar.cpp index bf6b59c5..74764883 100644 --- a/src/toolbar.cpp +++ b/src/toolbar.cpp @@ -153,11 +153,18 @@ bool GraphicsWindow::ToolbarDrawOrHitTest(int mx, int my, UiCanvas *canvas, double width, height; window->GetContentSize(&width, &height); - int x = 17, y = (int)(height - 52); + int x = 17, y = (int)(height - 21); // 20 is the menu bar height - // When changing these values, also change the asReference drawing code in drawentity.cpp. + // When changing these values, also change the asReference drawing code in drawentity.cpp + // as well as the "window->SetMinContentSize(720, 636);" in graphicswin.cpp int fudge = 8; - int h = 32*18 + 3*16 + fudge; + int h = 32*18 + 3*16 + fudge; // Toolbar height = 18 icons * 32 pixels + 3 dividers * 16 pixels + fudge + + if(h < y) { + // If there is enough vertical space leave up to 32 pixels between the menu bar and the toolbar. + y -= ((y - h) < 32) ? y - h : 32; + } + int aleft = 0, aright = 66, atop = y+16+fudge/2, abot = y+16-h; bool withinToolbar =