Do not set function parameters.

This commit is contained in:
John Hood
2016-11-07 01:03:17 -05:00
parent 2b3034b320
commit 9663edb7c7
+14 -14
View File
@@ -313,21 +313,21 @@ void Framebuffer::insert_line( int before_row, int count )
return; return;
} }
int max_scroll = ds.get_scrolling_region_bottom_row() + 1 - before_row; int scroll = ds.get_scrolling_region_bottom_row() + 1 - before_row;
if ( count > max_scroll ) { if ( count < scroll ) {
count = max_scroll; scroll = count;
} }
if ( count == 0 ) { if ( scroll == 0 ) {
return; return;
} }
// delete old rows // delete old rows
rows_type::iterator start = rows.begin() + ds.get_scrolling_region_bottom_row() + 1 - count; rows_type::iterator start = rows.begin() + ds.get_scrolling_region_bottom_row() + 1 - scroll;
rows.erase( start, start + count ); rows.erase( start, start + scroll );
// insert new rows // insert new rows
start = rows.begin() + before_row; start = rows.begin() + before_row;
rows.insert( start, count, newrow()); rows.insert( start, scroll, newrow());
} }
void Framebuffer::delete_line( int row, int count ) void Framebuffer::delete_line( int row, int count )
@@ -337,21 +337,21 @@ void Framebuffer::delete_line( int row, int count )
return; return;
} }
int max_scroll = ds.get_scrolling_region_bottom_row() + 1 - row; int scroll = ds.get_scrolling_region_bottom_row() + 1 - row;
if ( count > max_scroll ) { if ( count < scroll ) {
count = max_scroll; scroll = count;
} }
if ( count == 0 ) { if ( scroll == 0 ) {
return; return;
} }
// delete old rows // delete old rows
rows_type::iterator start = rows.begin() + row; rows_type::iterator start = rows.begin() + row;
rows.erase( start, start + count ); rows.erase( start, start + scroll );
// insert a block of dummy rows // insert a block of dummy rows
start = rows.begin() + ds.get_scrolling_region_bottom_row() + 1 - count; start = rows.begin() + ds.get_scrolling_region_bottom_row() + 1 - scroll;
rows.insert( start, count, newrow()); rows.insert( start, scroll, newrow());
} }
Row::Row( const size_t s_width, const color_type background_color ) Row::Row( const size_t s_width, const color_type background_color )