Fixed: incorrect CPWebView sizing after animation

This commit is contained in:
daboe01
2026-04-03 17:40:45 +02:00
parent b7ac5272d0
commit 65cb048b1b
+5 -1
View File
@@ -278,7 +278,11 @@ CPWebViewAppKitScrollMaxPollCount = 3;
if (_effectiveScrollMode === CPWebViewScrollAppKit)
{
var visibleRect = [_frameView visibleRect];
// Use `[_scrollView documentVisibleRect]` instead of `[_frameView visibleRect]`.
// `visibleRect` accounts for window clipping, which collapses to 0x0 if the view is
// animated off-screen, resulting in an incorrectly shrunken web layout.
var visibleRect = [_scrollView documentVisibleRect];
[_frameView setFrameSize:CGSizeMake(CGRectGetMaxX(visibleRect), CGRectGetMaxY(visibleRect))];
// try to get the document size so we can correctly set the frame