make minsize take int*'s not a Size*

This commit is contained in:
Dana Jansens 2003-04-15 18:05:25 +00:00
parent 3c960fb928
commit bbaef2ee57
2 changed files with 17 additions and 17 deletions

View file

@ -416,43 +416,43 @@ void pixel32_to_pixmap(pixel32 *in, Pixmap out, int x, int y, int w, int h)
free(scratch); free(scratch);
} }
void appearance_minsize(Appearance *l, Size *s) void appearance_minsize(Appearance *l, int *w, int *h)
{ {
int i; int i;
SIZE_SET(*s, 0, 0); *w = *h = 1;
switch (l->surface.type) { switch (l->surface.type) {
case Surface_Planar: case Surface_Planar:
if (l->surface.data.planar.relief != Flat) { if (l->surface.data.planar.relief != Flat) {
switch (l->surface.data.planar.bevel) { switch (l->surface.data.planar.bevel) {
case Bevel1: case Bevel1:
SIZE_SET(*s, 2, 2); *w = *h = 2;
break; break;
case Bevel2: case Bevel2:
SIZE_SET(*s, 4, 4); *w = *h = 4;
break; break;
} }
} else if (l->surface.data.planar.border) } else if (l->surface.data.planar.border)
SIZE_SET(*s, 2, 2); *w = *h = 2;
for (i = 0; i < l->textures; ++i) for (i = 0; i < l->textures; ++i)
switch (l->texture[i].type) { switch (l->texture[i].type) {
case Bitmask: case Bitmask:
s->width += l->texture[i].data.mask.mask->w; *w += l->texture[i].data.mask.mask->w;
s->height += l->texture[i].data.mask.mask->h; *h += l->texture[i].data.mask.mask->h;
break; break;
case Text: case Text:
s->width +=font_measure_string(l->texture[i].data.text.font, *w +=font_measure_string(l->texture[i].data.text.font,
l->texture[i].data.text.string, l->texture[i].data.text.string,
l->texture[i].data.text.shadow, l->texture[i].data.text.shadow,
l->texture[i].data.text.offset); l->texture[i].data.text.offset);
s->height += font_height(l->texture[i].data.text.font, *h += font_height(l->texture[i].data.text.font,
l->texture[i].data.text.shadow, l->texture[i].data.text.shadow,
l->texture[i].data.text.offset); l->texture[i].data.text.offset);
break; break;
case RGBA: case RGBA:
s->width += l->texture[i].data.rgba.width; *w += l->texture[i].data.rgba.width;
s->height += l->texture[i].data.rgba.height; *h += l->texture[i].data.rgba.height;
break; break;
case NoTexture: case NoTexture:
break; break;

View file

@ -156,6 +156,6 @@ void truecolor_startup(void);
void pseudocolor_startup(void); void pseudocolor_startup(void);
void pixel32_to_pixmap(pixel32 *in, Pixmap out, int x, int y, int w, int h); void pixel32_to_pixmap(pixel32 *in, Pixmap out, int x, int y, int w, int h);
void appearance_minsize(Appearance *l, Size *s); void appearance_minsize(Appearance *l, int *w, int *h);
#endif /*__render_h*/ #endif /*__render_h*/