From 14b5a67bf5ecd0301f08d643b00feca3010cfcc9 Mon Sep 17 00:00:00 2001 From: daboe01 Date: Sat, 13 Jun 2026 15:42:48 +0200 Subject: [PATCH] new: Clear the cached visible rect so it gets recalculated after size changes --- AppKit/CPTextView/CPTextView.j | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/AppKit/CPTextView/CPTextView.j b/AppKit/CPTextView/CPTextView.j index 32d9c6b88..cfde9194a 100644 --- a/AppKit/CPTextView/CPTextView.j +++ b/AppKit/CPTextView/CPTextView.j @@ -2069,8 +2069,16 @@ Sets the selection to a range of characters in response to user action. [self setFrameSize:[self frameSize]]; } +- (void)setBoundsSize:(CGSize)aSize +{ + _exposedRect = nil; // Clear the cached visible rect when bounds change + [super setBoundsSize:aSize]; +} + - (void)setFrameSize:(CGSize)aSize { + _exposedRect = nil; // Clear the cached visible rect so it gets recalculated at the new size + var desiredSize = CGSizeCreateCopy(aSize); if (_isHorizontallyResizable || _isVerticallyResizable)