diff --git a/Common/DefaultOptions.h b/Common/DefaultOptions.h index ad610ceb493ece0334714511e01a93c743f3becc..a4b6e47fb38a43c6c06bb200cc46091e30070c9f 100644 --- a/Common/DefaultOptions.h +++ b/Common/DefaultOptions.h @@ -1184,7 +1184,7 @@ StringXNumber ViewOptions_Number[] = { { F|O, "AutoPosition" , opt_view_auto_position , 1. , "Position the scale or 2D plot automatically (0: manual, 1: automatic, 2: top left, " "3: top right, 4: bottom left, 5: bottom right, 6: top, 7: bottom, 8: left, 9: right, " - "10: full)" }, + "10: full, 11: top third)" }, { F|O, "Axes" , opt_view_axes , 0 , "Axes (0=none, 1=simple axes, 2=box, 3=full grid, 4=open grid, 5=ruler)" }, { F|O, "AxesMikado" , opt_view_axes_mikado , 0. , diff --git a/Common/Options.cpp b/Common/Options.cpp index c3eff4c33af217fe95f2ed9df62c50afc1e7b9ee..7422799eae85d8f33124246446926b651f8f9bbf 100644 --- a/Common/Options.cpp +++ b/Common/Options.cpp @@ -6761,7 +6761,7 @@ double opt_view_auto_position(OPT_ARGS_NUM) GET_VIEWo(0.); if(action & GMSH_SET) { opt->autoPosition = (int)val; - if(opt->autoPosition < 0 || opt->autoPosition > 10) + if(opt->autoPosition < 0 || opt->autoPosition > 11) opt->autoPosition = 0; } #if defined(HAVE_FLTK) diff --git a/Fltk/optionWindow.cpp b/Fltk/optionWindow.cpp index 0b2efc055e6abf1ddb5b7b6dd20e0f76d2f707e2..916448db5a67b1ff53535e818ff0975471b806ad 100644 --- a/Fltk/optionWindow.cpp +++ b/Fltk/optionWindow.cpp @@ -107,6 +107,7 @@ static Fl_Menu_Item menu_position[] = { {"Left", 0, 0, 0}, {"Right", 0, 0, 0}, {"Full", 0, 0, 0}, + {"Top third", 0, 0, 0}, {0} }; diff --git a/Graphics/drawGraph2d.cpp b/Graphics/drawGraph2d.cpp index b6579b81ce453ea6b5a387d844b5e282a9eac5a4..c8c6440068e8b96429002cbf8bd1a4935ea9fe28 100644 --- a/Graphics/drawGraph2d.cpp +++ b/Graphics/drawGraph2d.cpp @@ -556,7 +556,7 @@ void drawContext::drawGraph2d() // | my+4*ysep | // +-----------------------------------------+ - int overlay[11] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; + int overlay[12] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; double winw = viewport[2] - viewport[0]; double winh = viewport[3] - viewport[1]; for(unsigned int i = 0; i < graphs.size(); i++){ @@ -584,9 +584,10 @@ void drawContext::drawGraph2d() drawGraph(this, p, x, viewport[3] - y, w, h, tic); } } - else if(opt->autoPosition >= 2 && opt->autoPosition <= 10){ + else if(opt->autoPosition >= 2 && opt->autoPosition <= 11){ // top left (2), top right (3), bottom left (4), bottom right (5), top - // half (6), bottom half (7), left half (8), right half (9), full (10) + // half (6), bottom half (7), left half (8), right half (9), full (10), + // top third (11) int a = opt->autoPosition; double w, h; if(a <= 5 || a == 8 || a == 9) @@ -595,6 +596,8 @@ void drawContext::drawGraph2d() w = winw - 2 * mx - 2 * xsep; if(a <= 5 || a == 6 || a == 7) h = (winh - 3 * my - 12 * ysep) / 2.; + else if(a == 11) + h = (winh - 3 * my - 12 * ysep) / 3.; else h = winh - 2 * my - 7 * ysep; if(a == 3 || a == 5 || a == 9) x += (w + mx + 2 * xsep);