From 0bdde991eafb22f0dc160084050141892d3a9d41 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Tue, 12 Jun 2018 06:48:48 +1000 Subject: [PATCH] Remove unneeded Window::m_range post refactoring --- src/window.cc | 7 ++----- src/window.hh | 3 --- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/src/window.cc b/src/window.cc index 09babb8f..fa932778 100644 --- a/src/window.cc +++ b/src/window.cc @@ -170,10 +170,7 @@ const DisplayBuffer& Window::update_display_buffer(const Context& context) m_display_buffer.optimize(); m_last_setup = build_setup(context); - - m_position.line = clamp(setup.window_pos.line - m_position_offset.line, 0_line, buffer().line_count()-1); - m_position.column = std::max(0_col, setup.window_pos.column - m_position_offset.column); - m_range = setup.window_range; + set_position(setup.window_pos - m_position_offset); if (profile and not (buffer().flags() & Buffer::Flags::Debug)) { @@ -188,7 +185,7 @@ const DisplayBuffer& Window::update_display_buffer(const Context& context) void Window::set_position(DisplayCoord position) { - m_position.line = std::max(0_line, position.line); + m_position.line = clamp(position.line, 0_line, buffer().line_count()-1); m_position.column = std::max(0_col, position.column); } diff --git a/src/window.hh b/src/window.hh index 284e82bc..f63fc9a1 100644 --- a/src/window.hh +++ b/src/window.hh @@ -22,8 +22,6 @@ public: const DisplayCoord& position() const { return m_position; } void set_position(DisplayCoord position); - const DisplayCoord& range() const { return m_range; } - const DisplayCoord& dimensions() const { return m_dimensions; } void set_dimensions(DisplayCoord dimensions, bool offset_pos = false); @@ -62,7 +60,6 @@ private: DisplayCoord m_position; DisplayCoord m_position_offset; - DisplayCoord m_range; DisplayCoord m_dimensions; DisplayBuffer m_display_buffer;