include/labwc.h: Provide MIN/MAX macros

This commit is contained in:
Consolatis 2023-01-06 15:06:57 +01:00
parent 9d7386effd
commit 7b48da4ab2
4 changed files with 8 additions and 6 deletions

View file

@ -123,10 +123,8 @@ get_scale_box(struct wlr_buffer *buffer, double container_width,
/* Scale down buffer if required */
if (icon_geo.width && icon_geo.height) {
#define MIN(a, b) ((a) < (b) ? (a) : (b))
double scale = MIN(container_width / icon_geo.width,
container_height / icon_geo.height);
#undef MIN
if (scale < 1.0f) {
icon_geo.width = (double)icon_geo.width * scale;
icon_geo.height = (double)icon_geo.height * scale;