Skip to content

Commit

Permalink
fix the final review comment
Browse files Browse the repository at this point in the history
  • Loading branch information
db48x committed Oct 6, 2024
1 parent 2b5eb18 commit 6c84d1a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions src/text.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,11 @@ Segment::Segment( const std::string_view( sv ), nc_color c )
, color( u32_from_color( c ) )
{}

Paragraph *parse_colored_text( const std::string_view str, nc_color default_color )
std::shared_ptr<Paragraph> parse_colored_text( const std::string_view str, nc_color default_color )
{
return ( new cataimgui::Paragraph() )->append_colored_text( str, default_color );
std::shared_ptr<Paragraph> p = std::make_shared<Paragraph>();
p->append_colored_text( str, default_color );
return p;
}

Paragraph::Paragraph( )
Expand Down
2 changes: 1 addition & 1 deletion src/text.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ struct Paragraph {
Paragraph *separated();
};

Paragraph *parse_colored_text( std::string_view str, nc_color default_color );
std::shared_ptr<Paragraph> parse_colored_text( std::string_view str, nc_color default_color );
void TextStyled( std::shared_ptr<Paragraph> para, float wrap_width = 0.0f );
void TextUnstyled( std::shared_ptr<Paragraph> para, float wrap_width = 0.0f );
void TextParagraph( nc_color color, std::string_view para, float wrap_width = 0.0f );
Expand Down

0 comments on commit 6c84d1a

Please sign in to comment.