Skip to content

Commit a094559

Browse files
authored
Update RasterizationScale.md
1 parent b8c84db commit a094559

1 file changed

Lines changed: 8 additions & 5 deletions

File tree

specs/RasterizationScale.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,11 @@ Callback<ICoreWebView2RasterizationScaleChangedEventHandler>(
4848
```
4949
## .Net
5050
```c#
51-
public void SetRasterizationScale(double rasterizaitonScale)
51+
public void SetRasterizationScale(double additionalScale)
5252
{
5353
CoreWebView2Controller.ShouldDetectMonitorScaleChanges = false;
54+
m_webviewAdditionalRasterizationScale = additionalScale;
55+
double rasterizationScale = additionalScale * GetDpiScale() * GetTextScale();
5456
CoreWebView2Controller.RasterizationScale = rasterizationScale;
5557
}
5658
```
@@ -76,8 +78,9 @@ interface ICoreWebView2Controller2 : ICoreWebView2Controller {
7678
/// \snippet AppWindow.cpp TextScaleChanged2
7779
///
7880
/// Rasterization scale applies to the WebView content, as well as
79-
/// popups, context menus, scroll bars, etc. Normal app scaling scenarios
80-
/// should use the ZoomFactor property or SetBoundsAndZoomFactor API.
81+
/// popups, context menus, scroll bars, and so on. Normal app scaling scenarios
82+
/// should use the ZoomFactor property or SetBoundsAndZoomFactor API which
83+
/// only scale the rendered HTML content and not popups, context menus, scroll bars and so on.
8184
///
8285
/// \snippet ViewComponent.cpp RasterizationScale
8386
[propget] HRESULT RasterizationScale([out, retval] double* scale);
@@ -130,7 +133,7 @@ public partial class CoreWebView2Controller
130133
/// </summary>
131134
/// <remarks>
132135
/// The rasterization scale is the combination of the monitor DPI scale and text scaling set by the user. This value shoud be updated when the DPI scale of the app's top level window changes (i.e. monitor DPI scale changes or the window changes monitor) or when the text scale factor of the system changes.
133-
/// Rasterization scale applies to the WebView content, as well as popups, context menus, scroll bars, etc. Normal app scaling scenarios should use the <see cref="CoreWebView2.ZoomFactor"/> property or <see cref="CoreWebView2.SetBoundsAndZoomFactor"/> method.
136+
/// Rasterization scale applies to the WebView content, as well as popups, context menus, scroll bars, and so on. Normal app scaling scenarios should use the <see cref="CoreWebView2.ZoomFactor"/> property or <see cref="CoreWebView2.SetBoundsAndZoomFactor"/> method.
134137
/// </remarks>
135138
public double RasterizationScale { get; set;};
136139

@@ -140,7 +143,7 @@ public partial class CoreWebView2Controller
140143
/// <remarks>
141144
/// ShouldDetectMonitorScaleChanges property determines whether the WebView attempts to track monitor DPI scale schanges. When true, the WebView will track monitor DPI scale changes, update the <see cref="CoreWebView2.RasterizationScale"/> property, and fire <see cref="CoreWebView2.RasterizationScaleChanged"/> event. When false, the WebView will not track monitor DPI scale changes, and the app must update the <see cref="CoreWebView2.RasterizationScale"/> property itself. <see cref="CoreWebView2.RasterizationScaleChanged"/> event will never fire when ShouldDetectMonitorScaleChanges is false.
142145
/// </remarks>
143-
public int ShouldDetectMonitorScaleChanges {get; set;};
146+
public bool ShouldDetectMonitorScaleChanges {get; set;};
144147

145148
/// <summary>
146149
/// RasterizationScalechanged is raised when the <see cref="CoreWebView2Controller.RasterizationScale"/> property changes.

0 commit comments

Comments
 (0)