mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
Change retrieval of buffers from sublayers to both clip relative
to the scrolled position of its parent layer and to offset the origin, since each layer assumes that its origin is 0,0.
This commit is contained in:
parent
b77c3eaaa0
commit
d6141edfd4
1 changed files with 7 additions and 2 deletions
|
@ -244,10 +244,15 @@ impl CompositorLayer {
|
|||
let transform = |x: &mut CompositorLayerChild| -> bool {
|
||||
match x.container.scissor {
|
||||
Some(scissor) => {
|
||||
let new_rect = window_rect.intersection(&scissor);
|
||||
let new_rect = rect.intersection(&scissor);
|
||||
match new_rect {
|
||||
Some(new_rect) => {
|
||||
x.child.get_buffer_request(new_rect, scale)
|
||||
// Child layers act as if they are rendered at (0,0), so we
|
||||
// subtract the layer's (x,y) coords in its containing page
|
||||
// to make the child_rect appear in coordinates local to it.
|
||||
let child_rect = Rect(new_rect.origin.sub(&scissor.origin),
|
||||
new_rect.size);
|
||||
x.child.get_buffer_request(child_rect, scale)
|
||||
}
|
||||
None => {
|
||||
false //Layer is offscreen
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue