mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +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))
|
||||
}
|
||||
|
||||
impl au {
|
||||
pub fn scale_by(factor: float) -> au {
|
||||
au(((*self as float) * factor) as i32)
|
||||
}
|
||||
}
|
||||
|
||||
pub pure fn zero_rect() -> Rect<au> {
|
||||
let z = au(0);
|
||||
Rect(Point2D(z, z), Size2D(z, z))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue