diff options
author | Ton Roosendaal <ton@blender.org> | 2003-10-22 21:34:51 +0400 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2003-10-22 21:34:51 +0400 |
commit | dbdc11690990f18015bb0bfe7a160fb0a18ec9b0 (patch) | |
tree | 9a7d2966de0fda2756f5fad1305488e37864fc18 /source/blender/src/drawimage.c | |
parent | 389b06c91e10b34c48fe048f59cea6ee236287bb (diff) |
- fixed bug: 'header select' themecolor had no alpha, causing antialiased
lines not drawn (triangles in buttons for example)
- correct colors for channels in texture buttons
- fixed bug: using proportional editing, the extra wire draw had incorrect
matrix
- fixed bug: drawing in imagewindow didnt work anymore... was a very old
one! the wrong pointer was read, and it accidentally went OK, until now
- selecting vertices with multiple 3d wins open works again
Diffstat (limited to 'source/blender/src/drawimage.c')
-rw-r--r-- | source/blender/src/drawimage.c | 109 |
1 files changed, 56 insertions, 53 deletions
diff --git a/source/blender/src/drawimage.c b/source/blender/src/drawimage.c index 29b9c504643..aa6e2228a0d 100644 --- a/source/blender/src/drawimage.c +++ b/source/blender/src/drawimage.c @@ -421,6 +421,7 @@ void drawimagespace(ScrArea *sa, void *spacedata) glClearColor(.1875, .1875, .1875, 0.0); glClear(GL_COLOR_BUFFER_BIT); + curarea->win_swap= WIN_BACK_OK; xmin= curarea->winrct.xmin; xmax= curarea->winrct.xmax; @@ -442,77 +443,79 @@ void drawimagespace(ScrArea *sa, void *spacedata) cpack(0x404040); glRectf(0.0, 0.0, 1.0, 1.0); draw_tfaces(); - - return; } - - /* calc location */ - x1= xmin+(curarea->winx-G.sima->zoom*ibuf->x)/2; - y1= ymin+(curarea->winy-G.sima->zoom*ibuf->y)/2; - - x1-= G.sima->zoom*G.sima->xof; - y1-= G.sima->zoom*G.sima->yof; - + else { + /* calc location */ + x1= xmin+(curarea->winx-G.sima->zoom*ibuf->x)/2; + y1= ymin+(curarea->winy-G.sima->zoom*ibuf->y)/2; + + x1-= G.sima->zoom*G.sima->xof; + y1-= G.sima->zoom*G.sima->yof; - if(G.sima->flag & SI_EDITTILE) { - rectwrite_part(xmin, ymin, xmax, ymax, x1, y1, ibuf->x, ibuf->y, (float)G.sima->zoom, (float)G.sima->zoom, ibuf->rect); - - dx= ibuf->x/G.sima->image->xrep; - dy= ibuf->y/G.sima->image->yrep; - sy= (G.sima->curtile / G.sima->image->xrep); - sx= G.sima->curtile - sy*G.sima->image->xrep; - - sx*= dx; - sy*= dy; - - calc_image_view(G.sima, 'p'); /* pixel */ - myortho2(G.v2d->cur.xmin, G.v2d->cur.xmax, G.v2d->cur.ymin, G.v2d->cur.ymax); - cpack(0x0); - glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); glRects(sx, sy, sx+dx-1, sy+dy-1); glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); - cpack(0xFFFFFF); - glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); glRects(sx+1, sy+1, sx+dx, sy+dy); glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); - } - else if(G.sima->mode==SI_TEXTURE) { - if(G.sima->image->tpageflag & IMA_TILES) { - - - /* just leave this a while */ - if(G.sima->image->xrep<1) return; - if(G.sima->image->yrep<1) return; - - if(G.sima->curtile >= G.sima->image->xrep*G.sima->image->yrep) - G.sima->curtile = G.sima->image->xrep*G.sima->image->yrep - 1; + if(G.sima->flag & SI_EDITTILE) { + rectwrite_part(xmin, ymin, xmax, ymax, x1, y1, ibuf->x, ibuf->y, (float)G.sima->zoom, (float)G.sima->zoom, ibuf->rect); dx= ibuf->x/G.sima->image->xrep; dy= ibuf->y/G.sima->image->yrep; - sy= (G.sima->curtile / G.sima->image->xrep); sx= G.sima->curtile - sy*G.sima->image->xrep; sx*= dx; sy*= dy; - rect= get_part_from_ibuf(ibuf, sx, sy, sx+dx, sy+dy); + calc_image_view(G.sima, 'p'); /* pixel */ + myortho2(G.v2d->cur.xmin, G.v2d->cur.xmax, G.v2d->cur.ymin, G.v2d->cur.ymax); - /* rect= ibuf->rect; */ - for(sy= 0; sy+dy<=ibuf->y; sy+= dy) { - for(sx= 0; sx+dx<=ibuf->x; sx+= dx) { - - rectwrite_part(xmin, ymin, xmax, ymax, - x1+sx*G.sima->zoom, y1+sy*G.sima->zoom, dx, dy, (float)G.sima->zoom, (float)G.sima->zoom, rect); + cpack(0x0); + glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); glRects(sx, sy, sx+dx-1, sy+dy-1); glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); + cpack(0xFFFFFF); + glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); glRects(sx+1, sy+1, sx+dx, sy+dy); glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); + } + else if(G.sima->mode==SI_TEXTURE) { + if(G.sima->image->tpageflag & IMA_TILES) { + + + /* just leave this a while */ + if(G.sima->image->xrep<1) return; + if(G.sima->image->yrep<1) return; + + if(G.sima->curtile >= G.sima->image->xrep*G.sima->image->yrep) + G.sima->curtile = G.sima->image->xrep*G.sima->image->yrep - 1; + + dx= ibuf->x/G.sima->image->xrep; + dy= ibuf->y/G.sima->image->yrep; + + sy= (G.sima->curtile / G.sima->image->xrep); + sx= G.sima->curtile - sy*G.sima->image->xrep; + + sx*= dx; + sy*= dy; + + rect= get_part_from_ibuf(ibuf, sx, sy, sx+dx, sy+dy); + + /* rect= ibuf->rect; */ + for(sy= 0; sy+dy<=ibuf->y; sy+= dy) { + for(sx= 0; sx+dx<=ibuf->x; sx+= dx) { + + rectwrite_part(xmin, ymin, xmax, ymax, + x1+sx*G.sima->zoom, y1+sy*G.sima->zoom, dx, dy, (float)G.sima->zoom, (float)G.sima->zoom, rect); + } } + + MEM_freeN(rect); } - - MEM_freeN(rect); + else + rectwrite_part(xmin, ymin, xmax, ymax, x1, y1, ibuf->x, ibuf->y, (float)G.sima->zoom,(float)G.sima->zoom, ibuf->rect); + + draw_tfaces(); } - else - rectwrite_part(xmin, ymin, xmax, ymax, x1, y1, ibuf->x, ibuf->y, (float)G.sima->zoom,(float)G.sima->zoom, ibuf->rect); - draw_tfaces(); + calc_image_view(G.sima, 'f'); /* float */ } - - calc_image_view(G.sima, 'f'); /* float */ + myortho2(-0.5, sa->winx-0.5, -0.5, sa->winy-0.5); + draw_area_emboss(sa); + myortho2(G.v2d->cur.xmin, G.v2d->cur.xmax, G.v2d->cur.ymin, G.v2d->cur.ymax); } void image_viewmove(void) |