From: ellson Date: Thu, 1 Nov 2007 21:29:16 +0000 (+0000) Subject: fix default=false for imagescale - now: imagescale=[false|true|width|height|both] X-Git-Tag: LAST_LIBGRAPH~32^2~5100 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3759adef86b6212823b84e9a4058339324df39d0;p=graphviz fix default=false for imagescale - now: imagescale=[false|true|width|height|both] --- diff --git a/lib/common/usershape.h b/lib/common/usershape.h index 3ce3e71df..1cd77c88e 100644 --- a/lib/common/usershape.h +++ b/lib/common/usershape.h @@ -29,8 +29,8 @@ extern "C" { } imagetype_t; typedef enum { - IMAGESCALE_NO, /* no image scaling */ - IMAGESCALE_YES, /* scale image to fit but keep aspect ratio */ + IMAGESCALE_FALSE, /* no image scaling */ + IMAGESCALE_TRUE, /* scale image to fit but keep aspect ratio */ IMAGESCALE_WIDTH, /* scale image width to fit, keep height fixed */ IMAGESCALE_HEIGHT, /* scale image height to fit, keep width fixed */ IMAGESCALE_BOTH /* scale image to fit without regard for aspect ratio */ diff --git a/lib/gvc/gvrender.c b/lib/gvc/gvrender.c index 30c6bca1a..d27bc0981 100644 --- a/lib/gvc/gvrender.c +++ b/lib/gvc/gvrender.c @@ -932,12 +932,12 @@ void gvrender_comment(GVJ_t * job, char *str) static imagescale_t get_imagescale(char *s) { - if (*s == '\0') return IMAGESCALE_YES; + if (*s == '\0') return IMAGESCALE_FALSE; if (!strcasecmp(s, "width")) return IMAGESCALE_WIDTH; if (!strcasecmp(s, "height")) return IMAGESCALE_HEIGHT; if (!strcasecmp(s, "both")) return IMAGESCALE_BOTH; - if (mapbool(s)) return IMAGESCALE_YES; - return IMAGESCALE_NO; + if (mapbool(s)) return IMAGESCALE_TRUE; + return IMAGESCALE_FALSE; } /* gvrender_usershape: @@ -980,7 +980,7 @@ void gvrender_usershape(GVJ_t * job, char *name, pointf * a, int n, scaley = ph / ih; switch (get_imagescale(imagescale)) { - case IMAGESCALE_YES: + case IMAGESCALE_TRUE: /* keep aspect ratio fixed by just using the smaller scale */ if (scalex < scaley) { iw *= scalex; @@ -1000,7 +1000,7 @@ void gvrender_usershape(GVJ_t * job, char *name, pointf * a, int n, iw *= scalex; ih *= scaley; break; - case IMAGESCALE_NO: + case IMAGESCALE_FALSE: default: break; }