Skip to content

Commit f954c94

Browse files
committed
set self.current_scroll_layer_id to None, if no matching layer exists anymore
1 parent 448f5df commit f954c94

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

webrender/src/scroll_tree.rs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,16 @@ impl ScrollTree {
194194
self.current_scroll_layer_id = Some(scroll_layer_id);
195195
scroll_layer_id
196196
},
197-
(_, _, Some(scroll_layer_id)) => scroll_layer_id,
197+
(_, scroll_layer_id, Some(cached_scroll_layer_id)) => {
198+
let scroll_layer_id = match self.layers.get(&cached_scroll_layer_id) {
199+
Some(layer) => cached_scroll_layer_id,
200+
None => {
201+
self.current_scroll_layer_id = Some(scroll_layer_id);
202+
scroll_layer_id
203+
},
204+
};
205+
scroll_layer_id
206+
},
198207
(_, _, None) => return false,
199208
};
200209

0 commit comments

Comments
 (0)