aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorNeil Hodgson <nyamatongwe@gmail.com>2023-03-02 16:17:33 +1100
committerNeil Hodgson <nyamatongwe@gmail.com>2023-03-02 16:17:33 +1100
commite18633f14c36732d007e8c5bb742cc7d3e69d22d (patch)
tree4a4bb6020d251ad1b7f067a5a7c10023fe869fdd
parenta55079bdcea7f3bbaae726166890841eb1ad1c2f (diff)
downloadscintilla-mirror-e18633f14c36732d007e8c5bb742cc7d3e69d22d.tar.gz
Backed out changeset: 5504b8444ec2
Failed to draw margins correctly after scrolling as the client rectangle wasn't updated.
-rw-r--r--cocoa/ScintillaCocoa.h2
-rw-r--r--cocoa/ScintillaCocoa.mm9
2 files changed, 4 insertions, 7 deletions
diff --git a/cocoa/ScintillaCocoa.h b/cocoa/ScintillaCocoa.h
index 402eeff20..4c1f10a97 100644
--- a/cocoa/ScintillaCocoa.h
+++ b/cocoa/ScintillaCocoa.h
@@ -103,8 +103,6 @@ private:
bool isFirstResponder;
bool isActive;
- PRectangle rectangleClient;
-
bool enteredSetScrollingSize;
bool GetPasteboardData(NSPasteboard *board, SelectionText *selectedText);
diff --git a/cocoa/ScintillaCocoa.mm b/cocoa/ScintillaCocoa.mm
index 66962e148..4f4fa1b71 100644
--- a/cocoa/ScintillaCocoa.mm
+++ b/cocoa/ScintillaCocoa.mm
@@ -737,7 +737,10 @@ Scintilla::Internal::Point ScintillaCocoa::GetVisibleOriginInMain() const {
* The returned value is in document coordinates.
*/
PRectangle ScintillaCocoa::GetClientRectangle() const {
- return rectangleClient;
+ NSScrollView *scrollView = ScrollContainer();
+ NSSize size = scrollView.contentView.bounds.size;
+ Point origin = GetVisibleOriginInMain();
+ return PRectangle(origin.x, origin.y, origin.x+size.width, origin.y + size.height);
}
//--------------------------------------------------------------------------------------------------
@@ -2030,10 +2033,6 @@ bool ScintillaCocoa::SetScrollingSize() {
void ScintillaCocoa::Resize() {
SetScrollingSize();
-
- NSScrollView *scrollView = ScrollContainer();
- rectangleClient = NSRectToPRectangle(scrollView.contentView.bounds);
-
ChangeSize();
}