mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-22 09:45:41 +00:00
servo: Rename int_to_au to px_to_au, etc.
Source-Repo: https://github.com/servo/servo Source-Revision: 8ea3faac03abc1a6b6a49a2d132c4f782ee3a7f2
This commit is contained in:
parent
7cc2b83a60
commit
a4e5f033d3
@ -29,10 +29,10 @@ fn zero_rect_au() -> rect<au> {
|
||||
{mut origin: point(z, z), mut size: size(z, z)}
|
||||
}
|
||||
|
||||
fn int_to_au(i: int) -> au {
|
||||
fn px_to_au(i: int) -> au {
|
||||
au(i * 60)
|
||||
}
|
||||
|
||||
fn au_to_int(au: au) -> int {
|
||||
fn au_to_px(au: au) -> int {
|
||||
*au / 60
|
||||
}
|
@ -61,10 +61,10 @@ fn draw_display_list(
|
||||
let red_pattern = AzCreateColorPattern(ptr::addr_of(red_color));
|
||||
|
||||
let red_rect = {
|
||||
x: au_to_int(bounds.origin.x) as AzFloat,
|
||||
y: au_to_int(bounds.origin.y) as AzFloat,
|
||||
width: au_to_int(bounds.size.width) as AzFloat,
|
||||
height: au_to_int(bounds.size.height) as AzFloat
|
||||
x: au_to_px(bounds.origin.x) as AzFloat,
|
||||
y: au_to_px(bounds.origin.y) as AzFloat,
|
||||
width: au_to_px(bounds.size.width) as AzFloat,
|
||||
height: au_to_px(bounds.size.height) as AzFloat
|
||||
};
|
||||
AzDrawTargetFillRect(
|
||||
draw_target,
|
||||
|
@ -29,7 +29,7 @@ fn layout(to_renderer: chan<renderer::msg>) -> chan<msg> {
|
||||
build(node) {
|
||||
#debug("layout: received layout request");
|
||||
let box = linked_subtree(node);
|
||||
base::reflow_block(box, geom::int_to_au(800));
|
||||
base::reflow_block(box, geom::px_to_au(800));
|
||||
let dlist = build_display_list(box);
|
||||
to_renderer.send(renderer::render(dlist));
|
||||
}
|
||||
|
@ -26,8 +26,8 @@ fn build_dom(scope: dom::node_scope,
|
||||
parser::to_start_tag("img") {
|
||||
#debug["IMG"];
|
||||
let new_node = scope.new_node(
|
||||
dom::nk_img({mut width: geom::int_to_au(100),
|
||||
mut height: geom::int_to_au(100)}));
|
||||
dom::nk_img({mut width: geom::px_to_au(100),
|
||||
mut height: geom::px_to_au(100)}));
|
||||
scope.add_child(cur, new_node);
|
||||
cur = new_node;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user