Skip to content

Commit fe51f72

Browse files
committed
Address api review comments
1 parent e61b612 commit fe51f72

1 file changed

Lines changed: 8 additions & 5 deletions

File tree

specs/IsPinchZoomEnabled.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ In this document we describe the new setting. We'd appreciate your feedback.
1414
# Description
1515
The default value for `IsPinchZoomEnabled` is `true`.
1616
When this setting is set to `false`, it disables the ability of the end users to use pinching motions on touch input enabled devices to scale the web content in the WebView2 and users cannot pinch zoom.
17+
Disabling/Enabling `IsPinchZoomEnabled` does not take effect until the next navigation, it only affects the end user's ability to use pinch motions and has no effect on the page scale factor.
1718

1819

1920
# Examples
@@ -26,10 +27,12 @@ void SettingsComponent::TogglePinchZooomEnabled()
2627
CHECK_FAILURE(webView->get_Settings(&coreWebView2Settings));
2728
wil::com_ptr<ICoreWebView2Settings4> coreWebView2Settings4;
2829
coreWebView2Settings4 = coreWebView2Settings.try_query<ICoreWebView2Settings4>();
29-
30-
BOOL enabled;
31-
CHECK_FAILURE(coreWebView2Settings4->get_IsPinchZoomEnabled(&enabled));
32-
CHECK_FAILURE(coreWebView2Settings4->put_IsPinchZoomEnabled(enabled ? FALSE : TRUE));
30+
if(coreWebView2Settings4)
31+
{
32+
BOOL enabled;
33+
CHECK_FAILURE(coreWebView2Settings4->get_IsPinchZoomEnabled(&enabled));
34+
CHECK_FAILURE(coreWebView2Settings4->put_IsPinchZoomEnabled(enabled ? FALSE : TRUE));
35+
}
3336
}
3437
```
3538

@@ -63,7 +66,7 @@ interface ICoreWebView2Settings4 : ICoreWebView2Settings3 {
6366
/// existing browser zoom properties (IsZoomControlEnabled and ZoomFactor)
6467
/// or other end user mechanisms for zooming.
6568
///
66-
/// \snippet SettingsComponent.cpp DisablePinchZoom
69+
/// \snippet SettingsComponent.cpp TogglePinchZooomEnabled
6770
[propget] HRESULT IsPinchZoomEnabled([out, retval] BOOL* enabled);
6871
/// Set the IsPinchZoomEnabled property
6972
[propput] HRESULT IsPinchZoomEnabled([in] BOOL enabled);

0 commit comments

Comments
 (0)