diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/Editor.cxx | 9 | ||||
-rw-r--r-- | src/Editor.h | 1 |
2 files changed, 8 insertions, 2 deletions
diff --git a/src/Editor.cxx b/src/Editor.cxx index 7144a422d..d64a09deb 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -274,6 +274,11 @@ Sci::Line Editor::TopLineOfMain() const noexcept { return topLine; } +Point Editor::ClientSize() const { + const PRectangle rcClient = GetClientRectangle(); + return Point(rcClient.Width(), rcClient.Height()); +} + PRectangle Editor::GetClientRectangle() const { return wMain.GetClientPosition(); } @@ -290,8 +295,8 @@ PRectangle Editor::GetTextRectangle() const { } Sci::Line Editor::LinesOnScreen() const { - const PRectangle rcClient = GetClientRectangle(); - const int htClient = static_cast<int>(rcClient.bottom - rcClient.top); + const Point sizeClient = ClientSize(); + const int htClient = static_cast<int>(sizeClient.y); //Platform::DebugPrintf("lines on screen = %d\n", htClient / lineHeight + 1); return htClient / vs.lineHeight; } diff --git a/src/Editor.h b/src/Editor.h index d757dd4c4..61e0dd5b0 100644 --- a/src/Editor.h +++ b/src/Editor.h @@ -308,6 +308,7 @@ protected: // ScintillaBase subclass needs access to much of Editor Point GetVisibleOriginInMain() const override; PointDocument DocumentPointFromView(Point ptView) const; // Convert a point from view space to document Sci::Line TopLineOfMain() const noexcept final; // Return the line at Main's y coordinate 0 + virtual Point ClientSize() const; virtual PRectangle GetClientRectangle() const; virtual PRectangle GetClientDrawingRectangle(); PRectangle GetTextRectangle() const; |