diff options
Diffstat (limited to 'Build/source/utils/asymptote/glrender.cc')
-rw-r--r-- | Build/source/utils/asymptote/glrender.cc | 31 |
1 files changed, 13 insertions, 18 deletions
diff --git a/Build/source/utils/asymptote/glrender.cc b/Build/source/utils/asymptote/glrender.cc index 824ecc6e07a..401f7a91ecd 100644 --- a/Build/source/utils/asymptote/glrender.cc +++ b/Build/source/utils/asymptote/glrender.cc @@ -77,8 +77,6 @@ bool Xspin,Yspin,Zspin; bool Animate; bool Step; -int minimumsize=50; // Minimum initial rendering window width and height - bool queueScreen=false; int x0,y0; @@ -531,22 +529,10 @@ void windowposition(int& x, int& y, int width=Width, int height=Height) } } -void setsize(int w, int h, int minsize=0, bool reposition=true) +void setsize(int w, int h, bool reposition=true) { int x,y; - if(minsize) { - if(w < minsize) { - h=(int) (h*(double) minsize/w+0.5); - w=minsize; - } - - if(h < minsize) { - w=(int) (w*(double) minsize/h+0.5); - h=minsize; - } - } - capsize(w,h); if(reposition) { windowposition(x,y,w,h); @@ -579,7 +565,7 @@ void fitscreen(bool reposition=true) case 0: // Original size { Xfactor=Yfactor=1.0; - setsize(oldWidth,oldHeight,minimumsize,reposition); + setsize(oldWidth,oldHeight,reposition); break; } case 1: // Fit to screen in one dimension @@ -590,7 +576,7 @@ void fitscreen(bool reposition=true) int h=screenHeight; if(w >= h*Aspect) w=(int) (h*Aspect+0.5); else h=(int) (w/Aspect+0.5); - setsize(w,h,minimumsize,reposition); + setsize(w,h,reposition); break; } case 2: // Full screen @@ -751,10 +737,18 @@ void capzoom() } +int menustatus=GLUT_MENU_NOT_IN_USE; + +void menuStatus(int status, int x, int y) +{ + menustatus=status; +} + void disableMenu() { Menu=false; - glutDetachMenu(MenuButton); + if(menustatus == GLUT_MENU_NOT_IN_USE) + glutDetachMenu(MenuButton); } void zoom(int x, int y) @@ -1649,6 +1643,7 @@ void glrender(const string& prefix, const picture *pic, const string& format, glutAddMenuEntry("(r) Reverse",REVERSE); glutAddMenuEntry("( ) Step",STEP); glutAddMenuEntry("(q) Quit" ,QUIT); + glutMenuStatusFunc(menuStatus); for(size_t i=0; i < nbuttons; ++i) { int button=buttons[i]; |