@@ -202,7 +202,7 @@ static void layout_setup(struct colored_layout *cl, int width, int height, doubl
202202 int icon_width = cl -> icon ? get_icon_width (cl -> icon , scale ) + horizontal_padding : 0 ;
203203 int text_width = width - 2 * settings .h_padding - (cl -> n -> icon_position == ICON_TOP ? 0 : icon_width );
204204 int progress_bar_height = have_progress_bar (cl ) ? settings .progress_bar_height + settings .padding : 0 ;
205- int max_text_height = MAX (0 , settings .height - progress_bar_height - 2 * settings .padding );
205+ int max_text_height = MAX (0 , settings .height . max - progress_bar_height - 2 * settings .padding );
206206 layout_setup_pango (cl -> l , text_width , max_text_height , cl -> n -> word_wrap , cl -> n -> ellipsize , cl -> n -> alignment );
207207}
208208
@@ -219,7 +219,7 @@ static void free_colored_layout(void *data)
219219static struct dimensions calculate_notification_dimensions (struct colored_layout * cl , double scale )
220220{
221221 struct dimensions dim = { 0 };
222- layout_setup (cl , settings .width .max , settings .height , scale );
222+ layout_setup (cl , settings .width .max , settings .height . max , scale );
223223
224224 int horizontal_padding = get_horizontal_text_icon_padding (cl -> n );
225225 int icon_width = cl -> icon ? get_icon_width (cl -> icon , scale ) + horizontal_padding : 0 ;
@@ -245,7 +245,7 @@ static struct dimensions calculate_notification_dimensions(struct colored_layout
245245 dim .h += progress_bar_height ;
246246 dim .w = dim .text_width + icon_width + 2 * settings .h_padding ;
247247
248- dim .h = MIN (settings .height , dim .h + settings .padding * 2 );
248+ dim .h = MIN (settings .height . max , dim .h + settings .padding * 2 );
249249 dim .w = MAX (settings .width .min , dim .w );
250250 if (have_progress_bar (cl ))
251251 dim .w = MAX (settings .progress_bar_min_width , dim .w );
@@ -709,7 +709,7 @@ static void render_content(cairo_t *c, struct colored_layout *cl, int width, dou
709709{
710710 // Redo layout setup, while knowing the width. This is to make
711711 // alignment work correctly
712- layout_setup (cl , width , settings .height , scale );
712+ layout_setup (cl , width , settings .height . max , scale );
713713
714714 const int h = layout_get_height (cl , scale );
715715 LOG_D ("Layout height %i" , h );
@@ -852,7 +852,7 @@ static struct dimensions layout_render(cairo_surface_t *srf,
852852 get_text_size (cl -> l , NULL , & h_text , scale );
853853
854854 int bg_width = 0 ;
855- int bg_height = MIN (settings .height , (2 * settings .padding ) + cl_h );
855+ int bg_height = MIN (settings .height . max , (2 * settings .padding ) + cl_h );
856856
857857 cairo_surface_t * content = render_background (srf , cl , cl_next , dim .y , dim .w , bg_height , dim .corner_radius , corners , & bg_width , scale );
858858 cairo_t * c = cairo_create (content );
@@ -866,10 +866,10 @@ static struct dimensions layout_render(cairo_surface_t *srf,
866866 if (corners & (C_BOT | _C_LAST ))
867867 dim .y += settings .frame_width ;
868868
869- if ((2 * settings .padding + cl_h ) < settings .height )
869+ if ((2 * settings .padding + cl_h ) < settings .height . max )
870870 dim .y += cl_h + 2 * settings .padding ;
871871 else
872- dim .y += settings .height ;
872+ dim .y += settings .height . max ;
873873
874874 if (settings .gap_size )
875875 dim .y += settings .gap_size ;
0 commit comments