mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
No longer consider window size when scrolling
Now that scrolling roots are properly sized, we can simply look at the scrolling root layer size when deciding the extents of layer scrolling. This simplifies things a bit and further codifies the current model of scrolling root + mask_to_bounds.
This commit is contained in:
parent
bae5440689
commit
31a6270d52
3 changed files with 14 additions and 24 deletions
|
@ -8,7 +8,7 @@ use pipeline::CompositionPipeline;
|
|||
|
||||
use azure::azure_hl::Color;
|
||||
use geom::point::TypedPoint2D;
|
||||
use geom::size::{Size2D, TypedSize2D};
|
||||
use geom::size::Size2D;
|
||||
use geom::rect::Rect;
|
||||
use gfx::render_task::UnusedBufferMsg;
|
||||
use layers::geometry::LayerPixel;
|
||||
|
@ -79,15 +79,13 @@ impl CompositorData {
|
|||
}
|
||||
|
||||
pub fn update_layer(layer: Rc<Layer<CompositorData>>, layer_properties: LayerProperties) {
|
||||
let size: TypedSize2D<LayerPixel, f32> = Size2D::from_untyped(&layer_properties.rect.size);
|
||||
layer.resize(size);
|
||||
layer.resize(Size2D::from_untyped(&layer_properties.rect.size));
|
||||
|
||||
// Call scroll for bounds checking if the page shrunk. Use (-1, -1) as the
|
||||
// cursor position to make sure the scroll isn't propagated downwards.
|
||||
events::handle_scroll_event(layer.clone(),
|
||||
TypedPoint2D(0f32, 0f32),
|
||||
TypedPoint2D(-1f32, -1f32),
|
||||
size);
|
||||
TypedPoint2D(-1f32, -1f32));
|
||||
CompositorData::update_layer_except_size(layer, layer_properties);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue