From ee2e64f273fc1b44273ee61edbde6c159ee4c080 Mon Sep 17 00:00:00 2001 From: Neil Hodgson Date: Tue, 22 Apr 2014 09:59:10 +1000 Subject: Hoisting some calculations into classes: ContractionState::DisplayLastFromDoc Range::First and Range::Last. Changing Editor::RectangleFromRange arguments to a Range. Simplifying code and specifying some local variables as const. --- src/ContractionState.cxx | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/ContractionState.cxx') diff --git a/src/ContractionState.cxx b/src/ContractionState.cxx index 0636d90ea..a5ecfe113 100644 --- a/src/ContractionState.cxx +++ b/src/ContractionState.cxx @@ -76,6 +76,10 @@ int ContractionState::DisplayFromDoc(int lineDoc) const { } } +int ContractionState::DisplayLastFromDoc(int lineDoc) const { + return DisplayFromDoc(lineDoc) + GetHeight(lineDoc) - 1; +} + int ContractionState::DocFromDisplay(int lineDisplay) const { if (OneToOne()) { return lineDisplay; -- cgit v1.2.3