@@ -461,7 +461,7 @@ static void Widget_ComputeActualContentBox(LCUI_Widget w,
461461
462462static size_t WidgetRenderer_RenderChildren (LCUI_WidgetRenderer that )
463463{
464- size_t count = 0 ;
464+ size_t total = 0 , count = 0 ;
465465 LCUI_Widget child ;
466466 LCUI_Rect paint_rect ;
467467 LinkedListNode * node ;
@@ -476,6 +476,11 @@ static size_t WidgetRenderer_RenderChildren(LCUI_WidgetRenderer that)
476476 child -> state != LCUI_WSTATE_NORMAL ) {
477477 continue ;
478478 }
479+ if (that -> target -> rules &&
480+ that -> target -> rules -> max_render_children_count &&
481+ count > that -> target -> rules -> max_render_children_count ) {
482+ break ;
483+ }
479484 style .x = that -> x + that -> content_left ;
480485 style .y = that -> y + that -> content_top ;
481486 Widget_ComputeActualBorderBox (child , & style );
@@ -490,8 +495,12 @@ static size_t WidgetRenderer_RenderChildren(LCUI_WidgetRenderer that)
490495 style .canvas_box .width , style .canvas_box .height );
491496 if (!LCUIRect_GetOverlayRect (& that -> content_rect ,
492497 & style .canvas_box , & paint_rect )) {
498+ if (count > 0 ) {
499+ ++ count ;
500+ }
493501 continue ;
494502 }
503+ ++ count ;
495504 Widget_ComputeActualPaddingBox (child , & style );
496505 Widget_ComputeActualContentBox (child , & style );
497506 if (that -> has_content_graph ) {
@@ -515,10 +524,10 @@ static size_t WidgetRenderer_RenderChildren(LCUI_WidgetRenderer that)
515524 Graph_Quote (& paint .canvas , & that -> root_paint -> canvas ,
516525 & paint_rect );
517526 renderer = WidgetRenderer (child , & paint , & style , that );
518- count += WidgetRenderer_Render (renderer );
527+ total += WidgetRenderer_Render (renderer );
519528 WidgetRenderer_Delete (renderer );
520529 }
521- return count ;
530+ return total ;
522531}
523532
524533static size_t WidgetRenderer_RenderContent (LCUI_WidgetRenderer that )
0 commit comments