mirror of
https://git.pwmt.org/pwmt/zathura.git
synced 2024-12-29 11:26:01 +01:00
Simplify
This commit is contained in:
parent
9e76d3eb4e
commit
02c30a7381
1 changed files with 6 additions and 20 deletions
|
@ -550,27 +550,13 @@ colorumax(const double h[3], double l, double l1, double l2)
|
|||
const double lv = (l - l1) / (l2 - l1); /* Remap l to the whole interval [0,1] */
|
||||
double u = DBL_MAX;
|
||||
double v = DBL_MAX;
|
||||
for (int k = 0; k < 3; k++) {
|
||||
for (unsigned int k = 0; k < 3; ++k) {
|
||||
if (h[k] > DBL_EPSILON) {
|
||||
const double uu = fabs((1-l)/h[k]);
|
||||
const double vv = fabs((1-lv)/h[k]);
|
||||
|
||||
if (uu < u) {
|
||||
u = uu;
|
||||
}
|
||||
if (vv < v) {
|
||||
v = vv;
|
||||
}
|
||||
u = fmin(fabs((1-l)/h[k]), u);
|
||||
v = fmin(fabs((1-lv)/h[k]), v);
|
||||
} else if (h[k] < -DBL_EPSILON) {
|
||||
const double uu = fabs(l/h[k]);
|
||||
const double vv = fabs(lv/h[k]);
|
||||
|
||||
if (uu < u) {
|
||||
u = uu;
|
||||
}
|
||||
if (vv < v) {
|
||||
v = vv;
|
||||
}
|
||||
u = fmin(fabs(l/h[k]), u);
|
||||
v = fmin(fabs(lv/h[k]), v);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -742,7 +728,7 @@ render(render_job_t* job, ZathuraRenderRequest* request, ZathuraRenderer* render
|
|||
&page_height, &page_width,
|
||||
false);
|
||||
|
||||
zathura_device_factors_t device_factors = zathura_document_get_device_factors(document);
|
||||
const zathura_device_factors_t device_factors = zathura_document_get_device_factors(document);
|
||||
page_width *= device_factors.x;
|
||||
page_height *= device_factors.y;
|
||||
|
||||
|
|
Loading…
Reference in a new issue