/** 标记指定范围内容的文本行的矩形为无效 */ void TextLayer_InvalidateRowsRect( LCUI_TextLayer layer, int start_row, int end_row ) { int i, y; LCUI_Rect rect; if( end_row < 0 || end_row >= layer->rowlist.length ) { end_row = layer->rowlist.length - 1; } y = layer->offset_y; for( i = 0; i < layer->rowlist.length; ++i ) { y += layer->rowlist.rows[i]->height; if( i >= start_row && y >= 0 ) { y -= layer->rowlist.rows[i]->height; break; } } for( ; i <= end_row; ++i ) { TextLayer_GetRowRect( layer, i, 0, -1, &rect ); RectList_Add( &layer->dirty_rect, &rect ); y += layer->rowlist.rows[i]->height; if( y >= layer->max_height ) { break; } } }
/** 标记指定文本行的矩形区域为无效 */ static void TextLayer_InvalidateRowRect( LCUI_TextLayer *layer, int i_row ) { LCUI_Rect rect; if( TextLayer_GetRowRect( layer, i_row, &rect ) == 0 ) { DirtyRectList_Add( &layer->dirty_rect, &rect ); } }
/** 标记指定文本行的矩形区域为无效 */ static void TextLayer_InvalidateRowRect( LCUI_TextLayer layer, int row, int start, int end ) { LCUI_Rect rect; if( TextLayer_GetRowRect( layer, row, start, end, &rect ) == 0 ) { RectList_Add( &layer->dirty_rect, &rect ); } }