static cairo_surface_t *surface = NULL;
static cairo_t *ctx = NULL;
cairo_surface_t *source;
- double rx, ry;
+ static double rx = 1.0, ry = 1.0;
if (data == NULL && surface == NULL && ctx == NULL)
{
data = malloc (WIDTH * HEIGHT * 4);
surface = cairo_image_surface_create_for_data (data, CAIRO_FORMAT_ARGB32,
WIDTH, HEIGHT, WIDTH * 4);
ctx = cairo_create (surface);
- rx = (double) WIDTH / (double) image->w;
- ry = (double) HEIGHT / (double) image->h;
- cairo_scale (ctx, rx, ry);
}
+ cairo_scale (ctx, 1.0/rx, 1.0/ry);
+ rx = (double) WIDTH / (double) image->w;
+ ry = (double) HEIGHT / (double) image->h;
+ cairo_scale (ctx, rx, ry);
source = CairoFromSDL (image);
cairo_set_source_surface (ctx, source, 0, 0);
cairo_paint (ctx);
SDL_Surface *text;
SDL_Rect box;
SDL_Color Yellow = { 255, 255, 0, 0};
- double rx, ry;
- rx = RX;
- ry = RY;
+ static double rx = RX, ry = RY, factor = 0.5;
+ if (rx < 0.25)
+ {
+ factor = 2;
+ }
+ if (rx > 2)
+ {
+ factor = 0.5;
+ }
+ rx *= RX;
+ ry *= RY;
center = GetNextPoint ();
slice = SDL_CreateRGBSurface (SDL_SWSURFACE, WIDTH*rx, HEIGHT*ry,
32,