@@ -461,7 +461,7 @@ static void Widget_ComputeActualContentBox(LCUI_Widget w,
461
461
462
462
static size_t WidgetRenderer_RenderChildren (LCUI_WidgetRenderer that )
463
463
{
464
- size_t count = 0 ;
464
+ size_t total = 0 , count = 0 ;
465
465
LCUI_Widget child ;
466
466
LCUI_Rect paint_rect ;
467
467
LinkedListNode * node ;
@@ -476,6 +476,11 @@ static size_t WidgetRenderer_RenderChildren(LCUI_WidgetRenderer that)
476
476
child -> state != LCUI_WSTATE_NORMAL ) {
477
477
continue ;
478
478
}
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
+ }
479
484
style .x = that -> x + that -> content_left ;
480
485
style .y = that -> y + that -> content_top ;
481
486
Widget_ComputeActualBorderBox (child , & style );
@@ -490,8 +495,12 @@ static size_t WidgetRenderer_RenderChildren(LCUI_WidgetRenderer that)
490
495
style .canvas_box .width , style .canvas_box .height );
491
496
if (!LCUIRect_GetOverlayRect (& that -> content_rect ,
492
497
& style .canvas_box , & paint_rect )) {
498
+ if (count > 0 ) {
499
+ ++ count ;
500
+ }
493
501
continue ;
494
502
}
503
+ ++ count ;
495
504
Widget_ComputeActualPaddingBox (child , & style );
496
505
Widget_ComputeActualContentBox (child , & style );
497
506
if (that -> has_content_graph ) {
@@ -515,10 +524,10 @@ static size_t WidgetRenderer_RenderChildren(LCUI_WidgetRenderer that)
515
524
Graph_Quote (& paint .canvas , & that -> root_paint -> canvas ,
516
525
& paint_rect );
517
526
renderer = WidgetRenderer (child , & paint , & style , that );
518
- count += WidgetRenderer_Render (renderer );
527
+ total += WidgetRenderer_Render (renderer );
519
528
WidgetRenderer_Delete (renderer );
520
529
}
521
- return count ;
530
+ return total ;
522
531
}
523
532
524
533
static size_t WidgetRenderer_RenderContent (LCUI_WidgetRenderer that )
0 commit comments