mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Use own ViewportDescription to clamp() initial_scale (#37337)
Use own `ViewportDescription` to `clamp()` initial_scale. If use `self` it will use current module `ViewportDescription`, which is old one because new `ViewportDescription` is not set yet. Testing: Tested Locally Fixes: #37338 Signed-off-by: Shubham Gupta <shubham13297@gmail.com>
This commit is contained in:
parent
73361d0f5f
commit
f1767e6c1e
1 changed files with 1 additions and 2 deletions
|
@ -1048,9 +1048,8 @@ impl WebViewRenderer {
|
|||
pub fn set_viewport_description(&mut self, viewport_description: ViewportDescription) {
|
||||
self.pending_scroll_zoom_events
|
||||
.push(ScrollZoomEvent::ViewportZoom(
|
||||
self.viewport_description
|
||||
viewport_description
|
||||
.clone()
|
||||
.unwrap_or_default()
|
||||
.clamp_zoom(viewport_description.initial_scale.get()),
|
||||
));
|
||||
self.viewport_description = Some(viewport_description);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue