I hesitate to call it a bugfix... but it's a removal of a very ancient
authorTon Roosendaal <ton@blender.org>
Mon, 28 Nov 2005 22:49:23 +0000 (22:49 +0000)
committerTon Roosendaal <ton@blender.org>
Mon, 28 Nov 2005 22:49:23 +0000 (22:49 +0000)
(2001) hack that enforced opening renderwindows smaller than screen size.

The notes I could find referred to testing old 3d cards, which failed to
give graphics memory for large windows. Another note was an issue on OSX,
where the topbar and windowbar gets hidden otherwise.
That latter case I corrected now.

Will organize good testing for this, if there's issues, will uncommit :)

source/blender/src/editscreen.c
source/blender/src/renderwin.c

index c81e7f2af3566e63819170ce30138beda4aeb7cf..b665c64e0e3e245df3024696a24a937196154c74 100644 (file)
@@ -1486,24 +1486,13 @@ void setprefsize(int stax, int stay, int sizx, int sizy)
        
        winlay_get_screensize(&scrwidth, &scrheight);
                
-//     if(stax<0) stax= 0;
-//     if(stay<0) stay= 0;
        if(sizx<320) sizx= 320;
        if(sizy<256) sizy= 256;
 
-//     if(stax+sizx>scrwidth) {
-//             fprintf(stderr," width prob \n");
-//             sizx= scrwidth-stax;
-//             }
-
        if(stay+sizy>scrheight) {
                fprintf(stderr," height prob \n");
                sizy= scrheight-stay;
-               }
-
-/* #ifdef __APPLE__ */
-/*     if(stay+sizy>scrheight-22) sizy= scrheight-22-stay;     // 22 = topbar  */
-/* #endif*/
+       }
 
        if(sizx<320 || sizy<256) {
                printf("ERROR: illegal prefsize\n");
index 15d7b8aef76351c4b0165b22324633ca7232665d..5483d8e27cf6d7cf3132c158f6e952142609095b 100644 (file)
@@ -604,12 +604,8 @@ void calc_renderwin_rectangle(int posmask, int renderpos_r[2], int rendersize_r[
        int scr_w, scr_h, x, y, div= 0;
        float ndc_x= 0.0, ndc_y= 0.0;
 
-               /* XXX, we temporarily hack the screen size and position so
-                * the window is always 60 pixels away from a side, really need
-                * a GHOST_GetMaxWindowBounds or so - zr
-                */
        winlay_get_screensize(&scr_w, &scr_h);
-       
+
        rendersize_r[0]= (G.scene->r.size*G.scene->r.xsch)/100;
        rendersize_r[1]= (G.scene->r.size*G.scene->r.ysch)/100;
        
@@ -623,9 +619,6 @@ void calc_renderwin_rectangle(int posmask, int renderpos_r[2], int rendersize_r[
                rendersize_r[0]*= G.scene->r.xparts;
                rendersize_r[1]*= G.scene->r.yparts;
        }
-       /* increased size of clipping for OSX, should become an option instead */
-       rendersize_r[0]= CLAMPIS(rendersize_r[0], 100, scr_w-120);
-       rendersize_r[1]= CLAMPIS(rendersize_r[1], 100, scr_h-120);
 
        for (y=-1; y<=1; y++) {
                for (x=-1; x<=1; x++) {
@@ -641,9 +634,14 @@ void calc_renderwin_rectangle(int posmask, int renderpos_r[2], int rendersize_r[
                ndc_x/= div;
                ndc_y/= div;
        }
-               
-       renderpos_r[0]= 60 + (scr_w-90-rendersize_r[0])*(ndc_x*0.5 + 0.5);
-       renderpos_r[1]= 30 + (scr_h-90-rendersize_r[1])*(ndc_y*0.5 + 0.5);
+       
+       renderpos_r[0]= (scr_w-rendersize_r[0])*(ndc_x*0.5 + 0.5);
+#ifdef __APPLE__
+       /* 44 pixels is topbar and window header... awaiting better fixes in ghost :) */
+       renderpos_r[1]= -44-RW_HEADERY+(scr_h-rendersize_r[1])*(ndc_y*0.5 + 0.5);
+#else
+       renderpos_r[1]= (scr_h-rendersize_r[1])*(ndc_y*0.5 + 0.5);
+#endif
 }
        
 /* init renderwin, alloc/open/resize */