[webkit-changes] [WebKit/WebKit] ed9218: [UnifiedPDF] Zoom out doesn't go out far enough wi...
Simon Fraser
noreply at github.com
Mon Apr 1 11:59:37 PDT 2024
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: ed9218bd94b98544ebaa74c34f2810a73dafd012
https://github.com/WebKit/WebKit/commit/ed9218bd94b98544ebaa74c34f2810a73dafd012
Author: Simon Fraser <simon.fraser at apple.com>
Date: 2024-04-01 (Mon, 01 Apr 2024)
Changed paths:
M Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/UnifiedPDFPlugin.h
M Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/UnifiedPDFPlugin.mm
Log Message:
-----------
[UnifiedPDF] Zoom out doesn't go out far enough with keyboard zoom
https://bugs.webkit.org/show_bug.cgi?id=271937
rdar://125386166
Reviewed by Tim Horton.
Internally, UnifiedPDFPlugin would adjust m_scaleFactor based on window-fitting
and other behaviors for the correct layout. However, the value exposed to
clients was somewhat arbitrary; m_scaleFactor==1 meant "fit to window", not
"actual size". This meant that the behavior of "Actual Size" from the PDF context
menu was different to "Actual Size" in the Safari menus, which just called
`setPageScaleFactor(1)`, and Command-+ and Command-- wouldn't work as expected.
Fix by computing a normalization factor so that the exposed scale factor is `1`
for actual size.
* Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/UnifiedPDFPlugin.h:
* Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/UnifiedPDFPlugin.mm:
(WebKit::UnifiedPDFPlugin::computeNormalizationFactor):
(WebKit::UnifiedPDFPlugin::fromNormalizedScaleFactor const):
(WebKit::UnifiedPDFPlugin::toNormalizedScaleFactor const):
(WebKit::UnifiedPDFPlugin::scaleFactor const):
(WebKit::UnifiedPDFPlugin::setScaleFactor):
(WebKit::UnifiedPDFPlugin::setPageScaleFactor):
(WebKit::UnifiedPDFPlugin::updateLayout):
Canonical link: https://commits.webkit.org/276890@main
To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications
More information about the webkit-changes
mailing list