From 9663edb7c715fec93780c5597af968f9fe510d21 Mon Sep 17 00:00:00 2001 From: John Hood Date: Mon, 7 Nov 2016 01:03:17 -0500 Subject: [PATCH] Do not set function parameters. --- src/terminal/terminalframebuffer.cc | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/terminal/terminalframebuffer.cc b/src/terminal/terminalframebuffer.cc index 93a3155..03026f6 100644 --- a/src/terminal/terminalframebuffer.cc +++ b/src/terminal/terminalframebuffer.cc @@ -313,21 +313,21 @@ void Framebuffer::insert_line( int before_row, int count ) return; } - int max_scroll = ds.get_scrolling_region_bottom_row() + 1 - before_row; - if ( count > max_scroll ) { - count = max_scroll; + int scroll = ds.get_scrolling_region_bottom_row() + 1 - before_row; + if ( count < scroll ) { + scroll = count; } - if ( count == 0 ) { + if ( scroll == 0 ) { return; } // delete old rows - rows_type::iterator start = rows.begin() + ds.get_scrolling_region_bottom_row() + 1 - count; - rows.erase( start, start + count ); + rows_type::iterator start = rows.begin() + ds.get_scrolling_region_bottom_row() + 1 - scroll; + rows.erase( start, start + scroll ); // insert new rows start = rows.begin() + before_row; - rows.insert( start, count, newrow()); + rows.insert( start, scroll, newrow()); } void Framebuffer::delete_line( int row, int count ) @@ -337,21 +337,21 @@ void Framebuffer::delete_line( int row, int count ) return; } - int max_scroll = ds.get_scrolling_region_bottom_row() + 1 - row; - if ( count > max_scroll ) { - count = max_scroll; + int scroll = ds.get_scrolling_region_bottom_row() + 1 - row; + if ( count < scroll ) { + scroll = count; } - if ( count == 0 ) { + if ( scroll == 0 ) { return; } // delete old rows rows_type::iterator start = rows.begin() + row; - rows.erase( start, start + count ); + rows.erase( start, start + scroll ); // insert a block of dummy rows - start = rows.begin() + ds.get_scrolling_region_bottom_row() + 1 - count; - rows.insert( start, count, newrow()); + start = rows.begin() + ds.get_scrolling_region_bottom_row() + 1 - scroll; + rows.insert( start, scroll, newrow()); } Row::Row( const size_t s_width, const color_type background_color )