mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +01:00
Implement au::scale_by
This commit is contained in:
parent
c2567fb2f3
commit
f7e3886231
1 changed files with 6 additions and 0 deletions
|
@ -39,6 +39,12 @@ pub fn box<A:Copy Num>(x: A, y: A, w: A, h: A) -> Rect<A> {
|
||||||
Rect(Point2D(x, y), Size2D(w, h))
|
Rect(Point2D(x, y), Size2D(w, h))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl au {
|
||||||
|
pub fn scale_by(factor: float) -> au {
|
||||||
|
au(((*self as float) * factor) as i32)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
pub pure fn zero_rect() -> Rect<au> {
|
pub pure fn zero_rect() -> Rect<au> {
|
||||||
let z = au(0);
|
let z = au(0);
|
||||||
Rect(Point2D(z, z), Size2D(z, z))
|
Rect(Point2D(z, z), Size2D(z, z))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue