Removed useless zl_cnt variable
This commit is contained in:
parent
711494ad36
commit
14d1daf280
8
image.c
8
image.c
|
@ -34,14 +34,12 @@
|
||||||
|
|
||||||
enum { MIN_GIF_DELAY = 50 };
|
enum { MIN_GIF_DELAY = 50 };
|
||||||
|
|
||||||
int zl_cnt;
|
|
||||||
float zoom_min;
|
float zoom_min;
|
||||||
float zoom_max;
|
float zoom_max;
|
||||||
|
|
||||||
void img_init(img_t *img, win_t *win) {
|
void img_init(img_t *img, win_t *win) {
|
||||||
zl_cnt = sizeof(zoom_levels) / sizeof(zoom_levels[0]);
|
|
||||||
zoom_min = zoom_levels[0] / 100.0;
|
zoom_min = zoom_levels[0] / 100.0;
|
||||||
zoom_max = zoom_levels[zl_cnt - 1] / 100.0;
|
zoom_max = zoom_levels[ARRLEN(zoom_levels) - 1] / 100.0;
|
||||||
|
|
||||||
if (img) {
|
if (img) {
|
||||||
img->im = NULL;
|
img->im = NULL;
|
||||||
|
@ -442,7 +440,7 @@ int img_zoom_in(img_t *img, win_t *win) {
|
||||||
if (!img || !img->im || !win)
|
if (!img || !img->im || !win)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
for (i = 1; i < zl_cnt; i++) {
|
for (i = 1; i < ARRLEN(zoom_levels); i++) {
|
||||||
if (zoom_levels[i] > img->zoom * 100.0)
|
if (zoom_levels[i] > img->zoom * 100.0)
|
||||||
return img_zoom(img, win, zoom_levels[i] / 100.0);
|
return img_zoom(img, win, zoom_levels[i] / 100.0);
|
||||||
}
|
}
|
||||||
|
@ -455,7 +453,7 @@ int img_zoom_out(img_t *img, win_t *win) {
|
||||||
if (!img || !img->im || !win)
|
if (!img || !img->im || !win)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
for (i = zl_cnt - 2; i >= 0; i--) {
|
for (i = ARRLEN(zoom_levels) - 2; i >= 0; i--) {
|
||||||
if (zoom_levels[i] < img->zoom * 100.0)
|
if (zoom_levels[i] < img->zoom * 100.0)
|
||||||
return img_zoom(img, win, zoom_levels[i] / 100.0);
|
return img_zoom(img, win, zoom_levels[i] / 100.0);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue