diff options
author | Mojca Miklavec <mojca.miklavec@gmail.com> | 2014-05-17 18:06:46 +0000 |
---|---|---|
committer | Mojca Miklavec <mojca.miklavec@gmail.com> | 2014-05-17 18:06:46 +0000 |
commit | 8e7ea45ebf7c1c4dbca970656d00684cc5d53720 (patch) | |
tree | 8c8a67fb417b3e9ccf6a4dcbd17361f8e36683f2 /Build/source/utils/asymptote/glrender.cc | |
parent | 02783996c279399df9780678ce424ab563bfee73 (diff) |
asy 2.31 sources
git-svn-id: svn://tug.org/texlive/trunk@34080 c570f23f-e606-0410-a88d-b1316a301751
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]; |