X-Git-Url: http://gitweb.michael.orlitzky.com/?a=blobdiff_plain;ds=sidebyside;f=io-svg.c;h=cf8864a1eb6a6ed40037bfb161e404da473826ae;hb=83f5680b39a1b77b24bdbce414354625be558bcf;hp=341d9e5939ed74f0fe9bb32803513bb7a2420941;hpb=0d835b47d51440c4355c701dfcf338ef050bc3cb;p=libsvgtiny-pixbuf.git diff --git a/io-svg.c b/io-svg.c index 341d9e5..cf8864a 100644 --- a/io-svg.c +++ b/io-svg.c @@ -300,21 +300,19 @@ static GdkPixbuf* gdk_pixbuf_from_svg_buffer(char* buffer, } - /* We're using the viewport width and height and not the diagram - * width/height for the image. The diagram can be of a different - * size and aspect ratio than the viewport, and our main use case is - * for icons that are generally square and reasonably sized. If the - * diagram is "small," then we want to scale it up until it fits - * nicely in the viewport before rendering it. That's as opposed to - * rendering the image small, and letting GDK scale it up. Of course - * this reasoning makes the assumption that the viewport is usually - * larger than the diagram. - */ + /* I've gone back and forth on this about five times: we use the + * diagram width and height, and not the viewport width and height. + * This can ultimately render an image that's larger than the + * viewport size, but I think GDK will resize the final pixbuf + * anyway. More importantly, rendering small icons at a larger + * (viewport) size seems to make the whole thing go ape-shit. + * So for now I'm back in the diagram camp. + */ pb = gdk_pixbuf_get_from_surface(cairo_get_target(cr), 0, 0, - VIEWPORT_WIDTH, - VIEWPORT_HEIGHT); + diagram->width, + diagram->height); if (!pb) {