mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Rename int_to_au to px_to_au, etc.
This commit is contained in:
parent
879a5c031e
commit
8ea3faac03
4 changed files with 9 additions and 9 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue