mirror of
https://github.com/labwc/labwc.git
synced 2025-11-05 13:29:58 -05:00
include/labwc.h: Provide MIN/MAX macros
This commit is contained in:
parent
9d7386effd
commit
7b48da4ab2
4 changed files with 8 additions and 6 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue