Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upChild layers do not scroll with their parent #283
Closed
Comments
|
With the patch below (I have no idea what I’m doing) the content of child layers moves correctly but its clipping rectangle doesn’t. diff --git a/src/frame.rs b/src/frame.rs
index f53b62b..8391a1d 100644
--- a/src/frame.rs
+++ b/src/frame.rs
@@ -1242,35 +1242,35 @@ impl Frame {
fn update_layer_transform(&mut self,
layer_id: ScrollLayerId,
parent_transform: &Matrix4D<f32>) {
// TODO(gw): This is an ugly borrow check workaround to clone these.
// Restructure this to avoid the clones!
let (layer_transform_for_children, layer_children) = {
match self.layers.get_mut(&layer_id) {
Some(layer) => {
let layer_transform_for_children =
parent_transform.mul(&layer.local_transform);
layer.world_transform =
layer_transform_for_children.translate(layer.world_origin.x,
layer.world_origin.y,
0.0)
.translate(layer.scrolling.offset.x,
layer.scrolling.offset.y,
0.0);
- (layer_transform_for_children, layer.children.clone())
+ (layer.world_transform, layer.children.clone())
}
None => {
return;
}
}
};
for child_layer_id in layer_children {
self.update_layer_transform(child_layer_id, &layer_transform_for_children);
}
} |
|
This is no longer occurring. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Test case: