- removed temporal patch from myortho2() in mywindow.c, and changed
authorTon Roosendaal <ton@blender.org>
Tue, 18 Nov 2003 11:22:17 +0000 (11:22 +0000)
committerTon Roosendaal <ton@blender.org>
Tue, 18 Nov 2003 11:22:17 +0000 (11:22 +0000)
  all calls to ortho2 with correctness offset of 0.375 instead of 0.5.
  this efficiently solves bug in drawing UV lines as reported.

cvS: ----------------------------------------------------------------------

16 files changed:
source/blender/src/butspace.c
source/blender/src/drawaction.c
source/blender/src/drawimage.c
source/blender/src/drawimasel.c
source/blender/src/drawipo.c
source/blender/src/drawnla.c
source/blender/src/drawoops.c
source/blender/src/drawseq.c
source/blender/src/drawsound.c
source/blender/src/drawtext.c
source/blender/src/editscreen.c
source/blender/src/filesel.c
source/blender/src/mywindow.c
source/blender/src/space.c
source/blender/src/spacetypes.c
source/blender/src/view.c

index 5488c71d8c79d4f6a00d58f01d439d7f3603bcf9..8313d19a3a84667661d6fba4644d2138065201b2 100644 (file)
@@ -455,7 +455,7 @@ void drawbutspace(ScrArea *sa, void *spacedata)
        sbuts->mainbo= sbuts->mainb;
        sbuts->tabo= sbuts->tab[sbuts->mainb];
 
-       myortho2(-0.5, (float)(sa->winx)-0.5, -0.5, (float)(sa->winy)-0.5);
+       myortho2(-0.375, (float)(sa->winx)-0.375, -0.375, (float)(sa->winy)-0.375);
        draw_area_emboss(sa);
        myortho2(v2d->cur.xmin, v2d->cur.xmax, v2d->cur.ymin, v2d->cur.ymax);
 
index fc79033c4967b18a433c5e8d27059be2cf1326d7..ff94e60c5514898fb3b850641e66ae0c8f58418c 100644 (file)
@@ -125,7 +125,7 @@ void meshactionbuts(SpaceAction *saction, Key *key)
         * correctly *grumble*
         */
        mywinset(curarea->win);
-       myortho2(-0.5, curarea->winx-0.5, -0.5, curarea->winy-0.5);
+       myortho2(-0.375, curarea->winx-0.375, -0.375, curarea->winy-0.375);
 
     sprintf(str, "actionbuttonswin %d", curarea->win);
     block= uiNewBlock (&curarea->uiblocks, str, 
@@ -615,7 +615,7 @@ void drawactionspace(ScrArea *sa, void *spacedata)
        /* Draw scroll */
        mywinset(curarea->win); // reset scissor too
        if(curarea->winx>SCROLLB+10 && curarea->winy>SCROLLH+10) {
-      myortho2(-0.5, curarea->winx-0.5, -0.5, curarea->winy-0.5);
+      myortho2(-0.375, curarea->winx-0.375, -0.375, curarea->winy-0.375);
       if(G.v2d->scroll) drawscroll(0);
        }
 
@@ -630,7 +630,7 @@ void drawactionspace(ScrArea *sa, void *spacedata)
        }
 
        mywinset(curarea->win); // reset scissor too
-       myortho2(-0.5, curarea->winx-0.5, -0.5, curarea->winy-0.5);
+       myortho2(-0.375, curarea->winx-0.375, -0.375, curarea->winy-0.375);
        draw_area_emboss(sa);
        curarea->win_swap= WIN_BACK_OK;
 }
index edfd5e30ded205ba4740f158f6143078439b2645..cd13b7eb920b5053f482f12299f8ed4402762ab6 100644 (file)
@@ -516,7 +516,7 @@ void drawimagespace(ScrArea *sa, void *spacedata)
        
                calc_image_view(G.sima, 'f');   /* float */
        }
-       myortho2(-0.5, sa->winx-0.5, -0.5, sa->winy-0.5);
+       myortho2(-0.375, sa->winx-0.375, -0.375, sa->winy-0.375);
        draw_area_emboss(sa);
        myortho2(G.v2d->cur.xmin, G.v2d->cur.xmax, G.v2d->cur.ymin, G.v2d->cur.ymax);
 }
index 3c73ca8061ece743e9d02852012dcf2099928959..03ec40a36388a5bd293517f8b5651a7387a3e291 100644 (file)
@@ -142,7 +142,7 @@ void viewgate(short sx, short sy, short ex, short ey)
        wx = curarea->winrct.xmin; wy = curarea->winrct.ymin;
        glViewport(wx+sx, wy+sy, (wx+ex )-(wx+sx)+1, (wy+ey )-(wy+sy)+1); 
        glScissor(wx+sx, wy+sy, (wx+ex )-(wx+sx)+1, (wy+ey )-(wy+sy)+1);
-       myortho2((float)sx-0.5 , (float)ex-0.5, (float)sy-0.5, (float)ey-0.5);
+       myortho2((float)sx-0.375 , (float)ex-0.375, (float)sy-0.375, (float)ey-0.375);
 }      
        
 void areaview (void) 
@@ -151,7 +151,7 @@ void areaview (void)
        wx = curarea->winrct.xmin; wy = curarea->winrct.ymin;
        glViewport(wx,  wy, curarea->winx, curarea->winy); 
        glScissor(wx,  wy, curarea->winx, curarea->winy); 
-       myortho2(-0.5, (float)(curarea->winx)-0.5, -0.5, (float)(curarea->winy)-0.5);
+       myortho2(-0.375, (float)(curarea->winx)-0.375, -0.375, (float)(curarea->winy)-0.375);
 
 }
                
@@ -867,7 +867,7 @@ void drawimaselspace(ScrArea *sa, void *spacedata)
        simasel= curarea->spacedata.first;
        
        /* ortho: xmin xmax, ymin, ymax! */
-       myortho2(-0.5, (float)(curarea->winx)-0.5, -0.5, (float)(curarea->winy)-0.5);
+       myortho2(-0.375, (float)(curarea->winx)-0.375, -0.375, (float)(curarea->winy)-0.375);
        
        if (simasel->fase == 0){
                checkdir(simasel->dir);
index ad4a53198457d7f68384fa54054a488150fe2389..aa1dba8454bf1d2e5732a35e95665523d5d34b96 100644 (file)
@@ -1676,7 +1676,7 @@ void drawipospace(ScrArea *sa, void *spacedata)
                if(sa->winx>SCROLLB+10 && sa->winy>SCROLLH+10) {
                        
                        /* ortho at pixel level sa */
-                       myortho2(-0.5, sa->winx-0.5, -0.5, sa->winy-0.5);
+                       myortho2(-0.375, sa->winx-0.375, -0.375, sa->winy-0.375);
                        
                        if(v2d->scroll) {
                                drawscroll(disptype);
@@ -1691,7 +1691,7 @@ void drawipospace(ScrArea *sa, void *spacedata)
                draw_ipogrid();
        }
        
-       myortho2(-0.5, sa->winx-0.5, -0.5, sa->winy-0.5);
+       myortho2(-0.375, sa->winx-0.375, -0.375, sa->winy-0.375);
        draw_area_emboss(sa);
 
        /* it is important to end a view in a transform compatible with buttons */
index fc36f1e10190bb0d30581e20b9c24ea7962588a8..5434505da8fc0841b5b3f06eb3be3a2866f61fd5 100644 (file)
@@ -447,7 +447,7 @@ void drawnlaspace(ScrArea *sa, void *spacedata)
        /* Draw scroll */
        mywinset(curarea->win); // reset scissor too
        if(curarea->winx>SCROLLB+10 && curarea->winy>SCROLLH+10) {
-               myortho2(-0.5, curarea->winx-0.5, -0.5, curarea->winy-0.5);
+               myortho2(-0.375, curarea->winx-0.375, -0.375, curarea->winy-0.375);
                if(G.v2d->scroll) drawscroll(0);
        }
 
@@ -455,7 +455,7 @@ void drawnlaspace(ScrArea *sa, void *spacedata)
        draw_nlatree();
 
        mywinset(curarea->win); // reset scissor too
-       myortho2(-0.5, sa->winx-0.5, -0.5, sa->winy-0.5);
+       myortho2(-0.375, sa->winx-0.375, -0.375, sa->winy-0.375);
        draw_area_emboss(sa);
        
        curarea->win_swap= WIN_BACK_OK;
index a0ea01ff770710bef43773a24daeeeae2fd6e2fd..5297f260d38d1c71e945480b97e6fbad47c2a490 100644 (file)
@@ -423,7 +423,7 @@ void drawoopsspace(ScrArea *sa, void *spacedata)
 
        
        /* ortho at pixel level curarea */
-       myortho2(-0.5, sa->winx-0.5, -0.5, sa->winy-0.5);
+       myortho2(-0.375, sa->winx-0.375, -0.375, sa->winy-0.375);
        if(G.v2d->scroll) {     
                drawscroll(0);          
        }
index d1c41eebc2336a47a9161410ae38a646ff3abb89..81da1d40b9f025709445cefc9b65377c8ab52aec 100644 (file)
@@ -646,7 +646,7 @@ void drawseqspace(ScrArea *sa, void *spacedata)
        mywinset(curarea->win);
 
        /* ortho at pixel level curarea */
-       myortho2(-0.5, curarea->winx-0.5, -0.5, curarea->winy-0.5);
+       myortho2(-0.375, curarea->winx-0.375, -0.375, curarea->winy-0.375);
 
        if(curarea->winx>SCROLLB+10 && curarea->winy>SCROLLH+10) {
                if(G.v2d->scroll) {
index a7acd3ba7dc865b2ee264b05ba22a29259caac06..bafd27f083343f5de717e53f401e3206226f3b8b 100644 (file)
@@ -229,7 +229,7 @@ void drawsoundspace(ScrArea *sa, void *spacedata)
        mywinset(curarea->win);
 
        /* ortho at pixel level curarea */
-       myortho2(-0.5, curarea->winx-0.5, -0.5, curarea->winy-0.5);
+       myortho2(-0.375, curarea->winx-0.375, -0.375, curarea->winy-0.375);
 
        if(curarea->winx>SCROLLB+10 && curarea->winy>SCROLLH+10) {
                if(G.v2d->scroll) {
@@ -237,7 +237,7 @@ void drawsoundspace(ScrArea *sa, void *spacedata)
                }
        }
        
-       myortho2(-0.5, curarea->winx-0.5, -0.5, curarea->winy-0.5);
+       myortho2(-0.375, curarea->winx-0.375, -0.375, curarea->winy-0.375);
        draw_area_emboss(sa);
        curarea->win_swap= WIN_BACK_OK;
 }
index bdbf753adc4850a0a1297afc88151b16dbc153b6..0e00824b7e3abd7781c9dc9d12d0e60d5fdde96b 100644 (file)
@@ -552,7 +552,7 @@ void drawtextspace(ScrArea *sa, void *spacedata)
        BIF_GetThemeColor3fv(TH_BACK, col);
        glClearColor(col[0], col[1], col[2], 0.0);
        glClear(GL_COLOR_BUFFER_BIT);
-       myortho2(-0.5, (float)(sa->winx)-0.5, -0.5, (float)(sa->winy)-0.5);
+       myortho2(-0.375, (float)(sa->winx)-0.375, -0.375, (float)(sa->winy)-0.375);
 
        draw_area_emboss(sa);
 
index 7a2d7e91ac28b1d7c406d3325391cd34c9c1758e..9c32ff6d54f97234fa791ef3e1d5b9e7a1ba3c1e 100644 (file)
@@ -366,9 +366,9 @@ void scrarea_do_headchange(ScrArea *area)
        float ofs= area->headbutofs;
 
        if (area->headertype==HEADERDOWN) {
-               bwin_ortho2(area->headwin, -0.5+ofs, area->headrct.xmax-area->headrct.xmin-0.5+ofs, -3.5, area->headrct.ymax-area->headrct.ymin-3.5);
+               bwin_ortho2(area->headwin, -0.375+ofs, area->headrct.xmax-area->headrct.xmin-0.375+ofs, -3.375, area->headrct.ymax-area->headrct.ymin-3.375);
        } else if (area->headertype==HEADERTOP) {
-               bwin_ortho2(area->headwin, -0.5+ofs, area->headrct.xmax-area->headrct.xmin-0.5+ofs, -2.5, area->headrct.ymax-area->headrct.ymin-2.5);
+               bwin_ortho2(area->headwin, -0.375+ofs, area->headrct.xmax-area->headrct.xmin-0.375+ofs, -2.375, area->headrct.ymax-area->headrct.ymin-2.375);
        }
 }
 
@@ -1780,7 +1780,7 @@ static bScreen *addscreen(char *name)             /* use setprefsize() if you want somethin
        
                glMatrixMode(GL_PROJECTION);
                glLoadIdentity();
-               myortho2(-0.5, sc->sizex-0.5, -0.5, sc->sizey-0.5);
+               myortho2(-0.375, sc->sizex-0.375, -0.375, sc->sizey-0.375);
                glMatrixMode(GL_MODELVIEW);
                glLoadIdentity();
 
@@ -2930,7 +2930,7 @@ void drawscreen(void)
        ScrArea *sa;
 
        mywinset(G.curscreen->mainwin);
-       myortho2(-0.5, (float)G.curscreen->sizex-0.5, -0.5, (float)G.curscreen->sizey-0.5);
+       myortho2(-0.375, (float)G.curscreen->sizex-0.375, -0.375, (float)G.curscreen->sizey-0.375);
 
        sa= G.curscreen->areabase.first;
        while(sa) {
index a13520281a583b87c54a9b355f794b88d2189e9c..c0bbc6f1b3e5994c609105fa9022c52f8787cec3 100644 (file)
@@ -1141,7 +1141,7 @@ void drawfilespace(ScrArea *sa, void *spacedata)
        char name[20];
        char *menu;
 
-       myortho2(-0.5, sa->winx-0.5, -0.5, sa->winy-0.5);
+       myortho2(-0.375, sa->winx-0.375, -0.375, sa->winy-0.375);
 
        BIF_GetThemeColor3fv(TH_HEADER, col);   // basic undrawn color is border
        glClearColor(col[0], col[1], col[2], 0.0); 
@@ -1197,7 +1197,7 @@ void drawfilespace(ScrArea *sa, void *spacedata)
        /* others diskfree etc ? */
        scrarea_queue_headredraw(curarea);      
        
-       myortho2(-0.5, (float)(sa->winx)-0.5, -0.5, (float)(sa->winy)-0.5);
+       myortho2(-0.375, (float)(sa->winx)-0.375, -0.375, (float)(sa->winy)-0.375);
        draw_area_emboss(sa);
        
        curarea->win_swap= WIN_BACK_OK;
index a9bc8d756d8dd98f5efba5b8c105a4ed5891c962..060cef8abc5383491179089020d573570f9d7f98 100644 (file)
@@ -427,15 +427,11 @@ void mywinposition(int winid, int xmin, int xmax, int ymin, int ymax) /* watch:
 void bwin_ortho(int winid, float x1, float x2, float y1, float y2, float n, float f)
 {
        bWindow *bwin= bwin_from_winid(winid);
-       float offs= 0.125;
        
        glMatrixMode(GL_PROJECTION);
        glLoadIdentity();
-       // in blender it's always called with -0.5... according to opengl
-       // manual it should be (-)0.375 for correctness. 
-       
-       //offs= 0.01*G.rt;
-       glOrtho(x1+offs, x2+offs, y1+offs, y2+offs, n, f);
+
+       glOrtho(x1, x2, y1, y2, n, f);
 
        glGetFloatv(GL_PROJECTION_MATRIX, (float *)bwin->winmat);
        glMatrixMode(GL_MODELVIEW);
index 29da5bead056e9f7ea81c8b8f089815362880b6b..098dc6e0cc33dc25e56125402277277c828a9501 100644 (file)
@@ -2450,7 +2450,7 @@ void drawinfospace(ScrArea *sa, void *spacedata)
 
        uiDrawBlock(block);
        
-       myortho2(-0.5, (float)(sa->winx)-0.5, -0.5, (float)(sa->winy)-0.5);
+       myortho2(-0.375, (float)(sa->winx)-0.375, -0.375, (float)(sa->winy)-0.375);
        draw_area_emboss(sa);
        myortho2(0.0, 1280.0, 0.0, curarea->winy/fac);
        sa->win_swap= WIN_BACK_OK;
index 8a0ba57f37303ef61c98ab19960f3207cba29816..060f00d64a7ed6e84e867e8510a2883dc586de7b 100644 (file)
@@ -124,7 +124,7 @@ void scrarea_do_winchange(ScrArea *area)
                st->winchange(area, area->spacedata.first);
        } else {
                if (!BLI_rcti_is_empty(&area->winrct)) {
-                       bwin_ortho2(area->win, -0.5, area->winrct.xmax-area->winrct.xmin-0.5, -0.5, area->winrct.ymax-area->winrct.ymin-0.5);
+                       bwin_ortho2(area->win, -0.375, area->winrct.xmax-area->winrct.xmin-0.375, -0.375, area->winrct.ymax-area->winrct.ymin-0.375);
                        glLoadIdentity();
                }
        }
index 5127ce78fbeca5ecf05ff40a35985251b35e44ee..2d45884d6cd8007ff2c4bd64547eed7d7797d1c3 100644 (file)
@@ -94,7 +94,7 @@ void persp_general(int a)
                glPushMatrix();
                glMatrixMode(GL_MODELVIEW);
 
-               myortho2(-0.5, ((float)(curarea->winx))-0.5, -0.5, ((float)(curarea->winy))-0.5);
+               myortho2(-0.375, ((float)(curarea->winx))-0.375, -0.375, ((float)(curarea->winy))-0.375);
                glLoadIdentity();
        }
        else if(a== 1) {
@@ -117,7 +117,7 @@ void persp(int a)
                mygetmatrix(G.vd->viewmat1); 
        }
        else if(a== PERSP_WIN) {                // only set
-               myortho2(-0.5, (float)(curarea->winx)-0.5, -0.5, (float)(curarea->winy)-0.5);
+               myortho2(-0.375, (float)(curarea->winx)-0.375, -0.375, (float)(curarea->winy)-0.375);
                glLoadIdentity();
        }
        else if(a== PERSP_VIEW) {