} 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 */
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:
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;
iw *= scalex;
ih *= scaley;
break;
- case IMAGESCALE_NO:
+ case IMAGESCALE_FALSE:
default:
break;
}