int target_width,
int target_height)
{
- double scale;
-
- scale = (double)target_width / doc_width;
-
- if (doc_height * scale > target_height)
- scale = (double)target_width / doc_width;
-
- return scale;
+ return (double)target_width / doc_width;
}
static double
int target_width,
int target_height)
{
- double scale;
-
- scale = (double)target_height / doc_height;
-
- if (doc_width * scale > target_width)
- scale = (double)target_height / doc_height;
-
- return scale;
+ return (double)target_height / doc_height;
}
static double
w_scale = (double)target_width / doc_width;
h_scale = (double)target_height / doc_height;
- if (doc_height * w_scale > target_height)
- w_scale = (double)target_width / doc_width;
- if (doc_width * h_scale > target_width)
- h_scale = (double)target_height / doc_height;
-
return MIN (w_scale, h_scale);
}