aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorNeil <nyamatongwe@gmail.com>2021-08-14 15:02:12 +1000
committerNeil <nyamatongwe@gmail.com>2021-08-14 15:02:12 +1000
commit551135e71f5196ee1fd92e017db8a704eb11f63b (patch)
tree06565e21eee830bb1391aa6aef7e43d92a451d54
parent8b71eb6d6065ec233b5b40adb9c6b10407c73fee (diff)
downloadscintilla-mirror-551135e71f5196ee1fd92e017db8a704eb11f63b.tar.gz
Cache the client rectangle to avoid system calls during intensive operations.
-rw-r--r--win32/ScintillaWin.cxx7
1 files changed, 7 insertions, 0 deletions
diff --git a/win32/ScintillaWin.cxx b/win32/ScintillaWin.cxx
index fc12e4807..5a35a659f 100644
--- a/win32/ScintillaWin.cxx
+++ b/win32/ScintillaWin.cxx
@@ -331,6 +331,7 @@ class ScintillaWin :
UINT dpi = USER_DEFAULT_SCREEN_DPI;
ReverseArrowCursor reverseArrowCursor;
+ PRectangle rectangleClient;
HRGN hRgnUpdate;
bool hasOKText;
@@ -464,6 +465,7 @@ class ScintillaWin :
sptr_t GetText(uptr_t wParam, sptr_t lParam);
Window::Cursor ContextCursor(Point pt);
sptr_t ShowContextMenu(unsigned int iMessage, uptr_t wParam, sptr_t lParam);
+ PRectangle GetClientRectangle() const override;
void SizeWindow();
sptr_t MouseMessage(unsigned int iMessage, uptr_t wParam, sptr_t lParam);
sptr_t KeyMessage(unsigned int iMessage, uptr_t wParam, sptr_t lParam);
@@ -1439,6 +1441,10 @@ sptr_t ScintillaWin::ShowContextMenu(unsigned int iMessage, uptr_t wParam, sptr_
return ::DefWindowProc(MainHWND(), iMessage, wParam, lParam);
}
+PRectangle ScintillaWin::GetClientRectangle() const {
+ return rectangleClient;
+}
+
void ScintillaWin::SizeWindow() {
#if defined(USE_D2D)
if (paintState == PaintState::notPainting) {
@@ -1448,6 +1454,7 @@ void ScintillaWin::SizeWindow() {
}
#endif
//Platform::DebugPrintf("Scintilla WM_SIZE %d %d\n", LOWORD(lParam), HIWORD(lParam));
+ rectangleClient = wMain.GetClientPosition();
ChangeSize();
}