Changeset 514 for trunk/src/core
- Timestamp:
- 08/08/16 18:25:48 (9 years ago)
- Location:
- trunk/src/core
- Files:
-
- 1 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/core/ascii_printer.cc
r487 r514 15 15 } 16 16 17 void ascii_printer::print( const string_view& text, const position& p, uint32color )17 void ascii_printer::print( const string_view& text, const position& p, term_color color ) 18 18 { 19 19 position coord( p ); 20 20 for ( char c : text ) 21 21 { 22 m_terminal->print( coord, color, c );22 m_terminal->print( coord, color, term_color(), c ); 23 23 ++coord.x; 24 24 if ( coord.x >= m_terminal->get_size().x ) break; … … 26 26 } 27 27 28 void nv::ascii_printer::frame( const nv::rectangle& area, const nv::string_view& border_chars, uint32color )28 void nv::ascii_printer::frame( const nv::rectangle& area, const nv::string_view& border_chars, term_color color ) 29 29 { 30 30 if ( border_chars.length() < 8 ) 31 31 { 32 m_terminal->clear( area );32 m_terminal->clear( area, color, term_color() ); 33 33 return; 34 34 } 35 m_terminal->clear( area.shrinked( 1 ) );35 m_terminal->clear( area.shrinked( 1 ), color, term_color() ); 36 36 for ( int x = 0; x < area.get_width(); ++x ) 37 37 { 38 m_terminal->print( position( area.ul.x + x, area.ul.y ), color, border_chars[0] );39 m_terminal->print( position( area.ul.x + x, area.lr.y ), color, border_chars[1] );38 m_terminal->print( position( area.ul.x + x, area.ul.y ), color, term_color(), border_chars[0] ); 39 m_terminal->print( position( area.ul.x + x, area.lr.y ), color, term_color(), border_chars[1] ); 40 40 } 41 41 42 42 for ( int y = 0; y < area.get_height(); ++y ) 43 43 { 44 m_terminal->print( position( area.ul.x, area.ul.y + y ), color, border_chars[2] );45 m_terminal->print( position( area.lr.x, area.ul.y + y ), color, border_chars[3] );44 m_terminal->print( position( area.ul.x, area.ul.y + y ), color, term_color(), border_chars[2] ); 45 m_terminal->print( position( area.lr.x, area.ul.y + y ), color, term_color(), border_chars[3] ); 46 46 } 47 47 48 m_terminal->print( area.ul, color, border_chars[4] );49 m_terminal->print( area.ur(), color, border_chars[5] );50 m_terminal->print( area.ll(), color, border_chars[6] );51 m_terminal->print( area.lr, color, border_chars[7] );48 m_terminal->print( area.ul, color, term_color(), border_chars[4] ); 49 m_terminal->print( area.ur(), color, term_color(), border_chars[5] ); 50 m_terminal->print( area.ll(), color, term_color(), border_chars[6] ); 51 m_terminal->print( area.lr, color, term_color(), border_chars[7] ); 52 52 }
Note: See TracChangeset
for help on using the changeset viewer.