Further fix for #8132, mac/nvidia driver issue drawing node previews,
authorBrecht Van Lommel <brechtvanlommel@pandora.be>
Mon, 22 Sep 2008 18:33:04 +0000 (18:33 +0000)
committerBrecht Van Lommel <brechtvanlommel@pandora.be>
Mon, 22 Sep 2008 18:33:04 +0000 (18:33 +0000)
zoom level was not correct.

source/blender/src/drawnode.c

index 853df3bedfcb380571023360668720562f5e71c5..d2586c9b781be014c69ed4848f4031ff82ecf131 100644 (file)
@@ -2468,7 +2468,16 @@ static void node_draw_preview(bNodePreview *preview, rctf *prv)
                }
        }
        
-       glPixelZoom(xscale, yscale);
+#ifdef __APPLE__
+       if(is_a_really_crappy_nvidia_card()) {
+               float zoomx= curarea->winx/(float)(G.v2d->cur.xmax-G.v2d->cur.xmin);
+               float zoomy= curarea->winy/(float)(G.v2d->cur.ymax-G.v2d->cur.ymin);
+               glPixelZoom(zoomx*xscale, zoomy*yscale);
+       }
+       else
+#endif
+               glPixelZoom(xscale, yscale);
+
        glEnable(GL_BLEND);
        glBlendFunc( GL_ONE, GL_ONE_MINUS_SRC_ALPHA );  /* premul graphics */