]> granicus.if.org Git - graphviz/commitdiff
fix default=false for imagescale - now: imagescale=[false|true|width|height|both]
authorellson <devnull@localhost>
Thu, 1 Nov 2007 21:29:16 +0000 (21:29 +0000)
committerellson <devnull@localhost>
Thu, 1 Nov 2007 21:29:16 +0000 (21:29 +0000)
lib/common/usershape.h
lib/gvc/gvrender.c

index 3ce3e71df00c89e4006d8c0c9fe636ed7aefa461..1cd77c88efb37e96e019f10eb45c6a661f512281 100644 (file)
@@ -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 */
index 30c6bca1af47a4a37bae647848815661a86d4768..d27bc0981f9fb124dba2721bc9597bae7384701d 100644 (file)
@@ -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;
     }