mirror of
https://github.com/servo/servo.git
synced 2025-08-07 06:25:32 +01:00
Implement Canvas pixel manipulation
This commit is contained in:
parent
e68d6d2924
commit
325400dce4
14 changed files with 305 additions and 84 deletions
|
@ -83,6 +83,16 @@ impl LayoutHTMLCanvasElementHelpers for LayoutJS<HTMLCanvasElement> {
|
|||
}
|
||||
}
|
||||
|
||||
pub trait HTMLCanvasElementHelpers {
|
||||
fn get_size(&self) -> Size2D<i32>;
|
||||
}
|
||||
|
||||
impl<'a> HTMLCanvasElementHelpers for JSRef<'a, HTMLCanvasElement> {
|
||||
fn get_size(&self) -> Size2D<i32> {
|
||||
Size2D(self.Width() as i32, self.Height() as i32)
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> HTMLCanvasElementMethods for JSRef<'a, HTMLCanvasElement> {
|
||||
fn Width(self) -> u32 {
|
||||
self.width.get()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue