Small refactoring in tns_load()
This commit is contained in:
		
							
								
								
									
										5
									
								
								thumbs.c
									
									
									
									
									
								
							
							
						
						
									
										5
									
								
								thumbs.c
									
									
									
									
									
								
							| @@ -82,11 +82,14 @@ void tns_load(tns_t *tns, win_t *win, int n, const char *filename) { | |||||||
|  |  | ||||||
| 	w = imlib_image_get_width(); | 	w = imlib_image_get_width(); | ||||||
| 	h = imlib_image_get_height(); | 	h = imlib_image_get_height(); | ||||||
|  |  | ||||||
|  | 	if (im) { | ||||||
| 		zw = (float) THUMB_SIZE / (float) w; | 		zw = (float) THUMB_SIZE / (float) w; | ||||||
| 		zh = (float) THUMB_SIZE / (float) h; | 		zh = (float) THUMB_SIZE / (float) h; | ||||||
| 		z = MIN(zw, zh); | 		z = MIN(zw, zh); | ||||||
| 	if (!im && z > 1.0) | 	} else { | ||||||
| 		z = 1.0; | 		z = 1.0; | ||||||
|  | 	} | ||||||
|  |  | ||||||
| 	t->w = z * w; | 	t->w = z * w; | ||||||
| 	t->h = z * h; | 	t->h = z * h; | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user