Create proper root ClipId when scrolling from script

WebRender currently makes a distinction between an external ClipId with
id equal to 0 and the root scroll ClipId. We need to detect this
situation and properly form the ClipId for the root.
This commit is contained in:
Martin Robinson 2017-04-19 12:55:59 +02:00
parent 0a54d5a025
commit 6017dc0836
4 changed files with 59 additions and 1 deletions

View file

@ -797,7 +797,12 @@ impl<Window: WindowMethods> IOCompositor<Window> {
pipeline_id: PipelineId,
scroll_root_id: ScrollRootId,
point: Point2D<f32>) {
let id = ClipId::new(scroll_root_id.0 as u64, pipeline_id.to_webrender());
let id = if scroll_root_id.0 == 0 {
ClipId::root_scroll_node(pipeline_id.to_webrender())
} else {
ClipId::new(scroll_root_id.0 as u64, pipeline_id.to_webrender())
};
self.webrender_api.scroll_node_with_id(LayoutPoint::from_untyped(&point), id);
}