mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Rename Au methods with f32/f64 instead of frac32/frac/subpx
This commit is contained in:
parent
32d5e24922
commit
8b522f2e7d
23 changed files with 99 additions and 99 deletions
|
@ -135,8 +135,8 @@ impl<'a> Activatable for JSRef<'a, HTMLAnchorElement> {
|
|||
let target_node = NodeCast::to_ref(target).unwrap();
|
||||
let rect = window_from_node(target_node).root().r().content_box_query(target_node.to_trusted_node_address());
|
||||
ismap_suffix = Some(
|
||||
format!("?{},{}", mouse_event.ClientX().to_f32().unwrap() - rect.origin.x.to_frac32_px(),
|
||||
mouse_event.ClientY().to_f32().unwrap() - rect.origin.y.to_frac32_px())
|
||||
format!("?{},{}", mouse_event.ClientX().to_f32().unwrap() - rect.origin.x.to_f32_px(),
|
||||
mouse_event.ClientY().to_f32().unwrap() - rect.origin.y.to_f32_px())
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -917,10 +917,10 @@ impl Window {
|
|||
}
|
||||
|
||||
fn should_move_clip_rect(clip_rect: Rect<Au>, new_viewport: Rect<f32>) -> bool{
|
||||
let clip_rect = Rect(Point2D(clip_rect.origin.x.to_frac32_px(),
|
||||
clip_rect.origin.y.to_frac32_px()),
|
||||
Size2D(clip_rect.size.width.to_frac32_px(),
|
||||
clip_rect.size.height.to_frac32_px()));
|
||||
let clip_rect = Rect(Point2D(clip_rect.origin.x.to_f32_px(),
|
||||
clip_rect.origin.y.to_f32_px()),
|
||||
Size2D(clip_rect.size.width.to_f32_px(),
|
||||
clip_rect.size.height.to_f32_px()));
|
||||
|
||||
// We only need to move the clip rect if the viewport is getting near the edge of
|
||||
// our preexisting clip rect. We use half of the size of the viewport as a heuristic
|
||||
|
|
|
@ -1180,7 +1180,7 @@ impl ScriptTask {
|
|||
fn scroll_fragment_point(&self, pipeline_id: PipelineId, node: JSRef<Element>) {
|
||||
let node: JSRef<Node> = NodeCast::from_ref(node);
|
||||
let rect = node.get_bounding_content_box();
|
||||
let point = Point2D(rect.origin.x.to_frac32_px(), rect.origin.y.to_frac32_px());
|
||||
let point = Point2D(rect.origin.x.to_f32_px(), rect.origin.y.to_f32_px());
|
||||
// FIXME(#2003, pcwalton): This is pretty bogus when multiple layers are involved.
|
||||
// Really what needs to happen is that this needs to go through layout to ask which
|
||||
// layer the element belongs to, and have it send the scroll message to the
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue